+ 1

Why is the java script code being placed just before the closing body tag ?

5th Sep 2020, 3:18 AM
Akanksha Kumari
Akanksha Kumari - avatar
2 Answers
+ 3
So that it load after all body content loaded and you don't get error like can't see property of null. If you keep it in <head> You document may take a little time to load.as it(body tag) will load after js(inside head)
5th Sep 2020, 3:28 AM
Divya Mohan
Divya Mohan - avatar