Welcome to the Treehouse Community
Looking to learn something new?
Christopher DeboveCourses Plus Student 18,372 Points
What is the purpose of DOMContentLoaded and script in head tag?
I already know the answer. I would like to have the opinion of the community.
What is the purpose of loading your script in the head tag? Basically :
- It increase the time at when the HTML is loaded
- You need to encapsulate the starting point of your script in a DOMContentLoaded event
- Referring to previous point your JS file is larger.
I don't really see any good for this kind of practice. Someone know a case of script (which have something to do with DOM) which need to be loaded on head tag ?
Here is the similar question for your reference:
Hope it helps.