Uncaught TypeError | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Uncaught TypeError

Other browser working fine. But sololearn said type error. They can't read AddEventListener Property! How to solve this problem? https://code.sololearn.com/WOPxuNxHXTJd/?ref=app

28th Oct 2021, 3:17 PM
Milon
Milon - avatar
2 Answers
+ 5
Just right whole JavaScript code inside Window onload window.onload=()=>{ //Your code goes here } Reason: Your HTML contens load before the JavaScript so you have to write JavaScript code inside the window.onload function so your Javascript code will execute after loading HTML contents.
28th Oct 2021, 3:21 PM
Pariket Thakur
Pariket Thakur - avatar
+ 4
Beauty Thanks❤️
28th Oct 2021, 3:27 PM
Milon
Milon - avatar