Stopping the buttons from disappearing? | Sololearn: Learn to code for FREE!
+ 1

Stopping the buttons from disappearing?

I made a button that writes a random number everytime you press it, but when the first number displays, the button disappears. How do I fix that? Edit: Here's the code.

9th Jan 2019, 6:19 PM
Ric2908 - avatar
2 Answers
+ 2 you use the document.write() function, it replaces the whole document with what you put inside the parentheses (these ones —> () <— ). So if you want to prevent that put the number in a specified place, a div. You can then replace the inner html with your number. (TIP use semicolumns; at the end of each line)
9th Jan 2019, 8:26 PM
Korijn Jagersma
Korijn Jagersma - avatar
+ 1
Aren't you using document.write function?
9th Jan 2019, 7:06 PM
Maneren - avatar