+ 1
Someone???? I need help with JavaScript. So.........
My problem is that I have my code inside a âwindow.onloadâ function. And then a âbutton.onclickâ. Inside the âbutton.onclickâ function I have a âresult.innerHTML = Numberâ. When I click the button the string changes but only like 3 seconds and it becomes the first string. I think that that is happening because is changing when the button is clicked. I need help with that. Iâll post the code in a following post so you can understand me better. My code has images so I donât know if SoloLearn would lag. Also I want to know how to keep track of life and donât always start again at 60. Thank you. Here is the Code: https://code.sololearn.com/Wkw4M45yLPh5/?ref=app
1 RĂ©ponse
+ 2
First of all you should use addEventListener not .onclick