0
[solved]Why can code_01 get property width,and code_02 can't ?
These script and jsfile are same code. When is jsfile of the 3files(html,css,js) read? https://code.sololearn.com/Wct92EwbeVWJ/?ref=app https://code.sololearn.com/Wp856UEfIxk6/?ref=app
2 Réponses
+ 3
Sololearn places javascript file inside head tag , so in code1 the script is executed before html dom is loaded and so there is no element with id "test1" yet.
+ 1
Thank you for Easy-to-understand explanation.And fast answer!