+ 2
Script tags location
what is the difference between placing script tag in head tag and placing script tag in body tag?
1 Answer
0
The page is loaded in the order you coded it, so if you try to access an element before it is loaded some functions like document.getElementById will return null.
https://code.sololearn.com/WHDYWt08ooO2/?ref=app