I made a rock, paper, scissors game and in the program, I have a button that should come up but it never does, It keeps giving me an error that says, \"Uncaught TypeError: Canno
The document.write
will overwrite your entire DOM, so the button you initialized onload will actually be overwritten by the contents of your document.write
.
However, if you do not want your content to disappear, I suggest making a new div
and using document.getElementById("div_id").innerHTML
in place of your document.write()
commands in order to save the button.