I added the following
(function addclick(){
getElementsByClassName("testclass").setAttribute("onclick", "myFN()");
})()
to the custom.js of my theme but I just can't update the target element.
I tested the function by replacing with an alert and it worked so it shouldn't be anything to do with it not be invoked. I also tried the jQuery attr() but also with no luck.
Any ideas? or I am just missing something?
Thanks!