Button doesn't show after [removed]

后端 未结 2 1223
悲&欢浪女
悲&欢浪女 2021-01-25 12:53

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

2条回答
  •  遥遥无期
    2021-01-25 13:13

    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.

提交回复
热议问题