+ 2

Why error if i click on anywhere

It said cannot read property of classList of null https://code.sololearn.com/Wst08cUjJzZN/?ref=app

19th Aug 2020, 10:19 AM
Papa Penguin
2 Answers
+ 2
place your js code inside this function window.onload=function(){ } Use search bar to search for similar question if you want to know what window.onload do and why is it used ,by default sololearn places js script inside head element and so it gets executed before the body part
19th Aug 2020, 10:22 AM
Abhay
Abhay - avatar