+ 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. https://code.sololearn.com/WVb76c2I6PIY/?ref=app

9th Jan 2019, 6:19 PM
Ric2908
Ric2908 - avatar
2 Antworten
+ 2
https://code.sololearn.com/W58S2Gwobt24/?ref=app 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
Maneren - avatar