I'm trying to add html elements to by index.html document using document.write(); The code that's giving me trouble is as follows:
... + "<td class='navbutton' onclick="location.href='./page1.html'">" + ...
The trouble is that the tag itself has to be inside quotes, and the onclick attribute within the tag contains quotes nested in quotes. I've tried using \ to include everything within the onclick element, but to no avail (I just get a console error saying,
Uncaught SyntaxError: missing ) after argument list
Can someone help me understand how to implement these triple nested quotes? Thank you