JavaScript to Bubble Uncaught Reference Error

I think what may be happening is your HTML element is being rendered before the JavascriptToBubble element is being rendered.

So the script in the HTML element is being ran before the JavascriptToBubble element is visible on the page.

Try setting the HTML element to not visible on page load, and set a conditional to show the HTML element after page loaded (entire)