+ 1
How do I make a button stay?
In case you saw my previous question, I made the clicker work but now the button disappears onclick, how do I make it stay? Here's all my code: https://code.sololearn.com/WdRcwPdcdGIk/?ref=app
2 Respuestas
+ 2
When you do document.write it overwrites the entire document with "Money: x" and deleted the button tag, you have to be more specific to the specific element. I'll show an example in a sec.
Update: alright, should work. You also need to remember semi colons. I used document.getElementById to get to the p tag and changed the inner html to money: x.
https://code.sololearn.com/WHRY5KoyZbsg/#html
+ 1
Hey @Koalafied why did you deleted a question I answered wrong?? I was looking for solution and I just found it.
Veryyyyyyyyyy messy code but it works the same as @Jordan Chapman's
https://code.sololearn.com/W8615V8h61Ac/?ref=app