When dealing with javascript, it is important to first verify that the template passes an html validation. Errors in the that validation may prevent firing of the javascript, also, other javascript may interact/override the actions that are being waited on which can depend on load sequence of the javascript (for example the code here has been modified to also listen for the change of attribute selections instead of replacing any previous/other listening operations), then also it is good to watch execution of javascript through your browser to see what is going on, if there are any console errors, etc... This last thing can be done through pressing F12 while using your browser with the suggestion to reload the page after doing that.

Otherwise, for others to help the web page would need to be provided so that they can do the same or similar actions as described.