0

HELP ! Js sololearn code editor doesn't work for me !

I was trying to try hiding some element in my html by giving the command (document.getElementById ('hide').style.display = 'none';) but I always find this answer (Uncaught typeError: cannot read property 'style' of null line:2 ) and if did the same code inside of an html doc or in another word Internal js it work normal <html> <head> <title></title> </head> <body> <div id="hide">Lets go to school tomorrow</div> </body> </html> this is my html code

26th Jan 2017, 11:00 AM
Abdessamad Chrouki
Abdessamad Chrouki - avatar
2 Answers
+ 1
Do you have any HTML element with id = 'hide'?
26th Jan 2017, 11:01 AM
Álvaro
+ 1
yes I have an id of hide inside of div element
26th Jan 2017, 11:03 AM
Abdessamad Chrouki
Abdessamad Chrouki - avatar