Why is this AddEventListener Method not working | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why is this AddEventListener Method not working

It's working on the browser on my laptop perfectly well, i just posted it here and it's not working the way it should... 🙁 https://code.sololearn.com/WW45pvtdrJ6M/?ref=app https://code.sololearn.com/WW45pvtdrJ6M/?ref=app

13th Nov 2018, 3:34 PM
Anthonia Asikpo
2 Answers
+ 2
Its because sololearn loads the javascript before the page is fully loaded so you just need to wrap your code in a window.onload = function (){ (all the code) }
13th Nov 2018, 4:35 PM
Mike
0
Thanks Mike
4th Feb 2019, 11:11 AM
Anthonia Asikpo