

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
- Related Questions & Answers
- Why people prefer smartphones to laptops nowadays?
- How to use JavaScript to redirect an HTML page?
- How to include an external JavaScript inside an HTML page?
- How to put a complete HTML page in a div using jQuery?
- How to include inline JavaScript inside an HTML page?
- HTML DOM Footer object
- How to create table footer in HTML?
- How to display JavaScript variables in an HTML page without document.write?
- Why do we use head tag in HTML Page?
- How to redirect from an HTML page?
- Why do shareholders prefer Current Dividend over Capital Gain?
- How to Insert an Image in HTML Page?
- Footer of the modal in Bootstrap
- How to use an animated image in HTML page?
- How to write inline JavaScript code in HTML page?
Advertisements