Why it shows me this eror | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
28th Oct 2020, 5:12 AM
Çrèàtìvè Sàt
Çrèàtìvè Sàt - avatar
2 Answers
+ 2
Codes on JS tag are placed on HTML head tag and hence the code runs before dom loads. Place your script on body tag or use: window.onload = function(){ //Your code here } Use the search bar next time. This question is faq: https://www.sololearn.com/Discuss?ordering=MostRecent&query=cannot%20null
28th Oct 2020, 5:30 AM
Kevin ★
+ 1
Thanks Kevin ★ .Solved
28th Oct 2020, 5:35 AM
Çrèàtìvè Sàt
Çrèàtìvè Sàt - avatar