
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Why Prefer to Put JavaScript in the Footer of an HTML Page
With JavaScript, you can put JavaScript anywhere on the page, whether inside <head> or <body> tag. But, it is a good practice to add JavaScript in the footer i.e. just before closing the <body> tag. This is because −
- It loads script faster.
- It will not block any DOM content to load.
- It loads the web page before loading JavaScript
- Improves display speed
- Page loads faster
Advertisements