I’m trying to insert HTML code into a page using JS. I need to insert it on a variety of pages for a test, and the first page I coded it for worked great. Here’s the basic code I used:
I have been trying to figure out how to insert the code into the other pages required. The elements on these pages are rarely assigned an id.
My question is… how do I use JS to insert HTML (represented by “HTML code goes here” above) into a page when there aren’t any immediately adjacent or nearby elements that have an id?