Set innerHTML to a variable
So, I have this code as the body of an HTML file ...
<body> <ol> <li id="x1"> Item 1 </li> <li> Item 2 </li> </ol> <script type="text/javascript"> var ds = "new text"; document.getElementById("x1").innerHTML = ds; </script> </body> But for some reason, the innerHTML line does not change "Item 1" to "new text." Not sure what is wrong here.
EDIT: I am using Firefox version 10.0.02, no errors occur in the console, and this is the only thing that uses this identifier on the page.
+4