Hello everyone, could you tell me please, why innerHTMl is identified as null? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 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 Respuestas
+ 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