Custom code on self-hosted Webflow website is throwing error

As you can see, this is still throwing error, because the element is not ready yet.

  1. Are you sure you have an element with loadButton unique id?
  2. Try wrapping your code within
$(document).ready(function() {
  // your custom code goes here...
});