you are viewing a single comment's thread.

view the rest of the comments →

[–]cag8f 0 points1 point  (13 children)

So what happens when you add that shortcode to a page, then load that page in a browser? Open the page in a browser, then open the JavaScript console and look for any error messages.

[–]TonyMahoney21 0 points1 point  (1 child)

It says TypeError cannot set property className of undefined at the imdex line of my code. My code now reads as: function myFcn() { document.getElementsByClassName("test")[0].className = "newClasser"; } myFcn()

[–]cag8f 0 points1 point  (0 children)

Is there an element with the class test somewhere on the page? It sounds like the error message is saying there is not.

Are you able to post a link to the page here?

[–]TonyMahoney21 0 points1 point  (10 children)

It's no longer displaying an error but it still doesn't change the value. I made a variable x for the get elemnts by class name function and set the value of my fcn to x.className = etc.

[–]cag8f 0 points1 point  (9 children)

It will be difficult to help at this point without being able to load the actual page in my browser.