Hello everyone, could you tell me please, why innerHTMl is identified as null? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Hello everyone, could you tell me please, why innerHTMl is identified as null?

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

1st Jul 2020, 8:15 PM
Sergei Keidzh
2 Answers
+ 2
Sergei Keidzh Because JavaScript load before loading Html so you need to write JavaScript code inside onload event. write Javascript code inside this window.onload = function(){ } or call your function like window.onload = function(){ sty(); }
1st Jul 2020, 8:28 PM
A͢J
A͢J - avatar
+ 2
Thanks a lot!
2nd Jul 2020, 7:53 PM
Sergei Keidzh