Hello everyone, could you tell me please, why innerHTMl is identified as null? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Respostas
+ 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