The onclick button is not functioning, any idea what might have caused this? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

The onclick button is not functioning, any idea what might have caused this?

https://code.sololearn.com/W7Zha2qqw2ZB/?ref=app

16th May 2019, 3:23 PM
Adefisoye Ayomide
Adefisoye Ayomide - avatar
2 Answers
+ 1
It's the usual problem here of JavaScript running before the HTML is fully loaded. To fix it, simply encase everything in the JavaScript tab within: window.onload = function(){ All of your current JavaScript here } That will cause the JavaScript to not run until the HTML is fully loaded and so fixes that error.
16th May 2019, 3:25 PM
Decimis † 𝕯𝖊𝖈𝖎𝖒𝖎𝖘
Decimis † 𝕯𝖊𝖈𝖎𝖒𝖎𝖘 - avatar
+ 1
Thank you very much
16th May 2019, 3:30 PM
Adefisoye Ayomide
Adefisoye Ayomide - avatar