Why is the java script code being placed just before the closing body tag ? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 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
1 ответ
+ 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