+ 4

Is it js write in head or body tag ? What is the difference?

28th Aug 2017, 4:51 AM
Salah Ayoob
Salah Ayoob - avatar
2 Answers
+ 6
https://code.sololearn.com/WA7HLbc7nU4A/?ref=app 1.in head that will throw null because of <b> not fully loaded yet while in body That is opposite 2.place your script inside body will be faster than place in head
28th Aug 2017, 5:21 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 4
You actually should realise what head and body are for. Head is for writing information not displayed directly in the code such as meta,link,script&style(also in body) The ones you wanna see is in the body, such as h1 h4 p progress table Etc.
28th Aug 2017, 5:27 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar