Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (7k points)

What is the best place to insert a script tag in an HTML document?

1 Answer

0 votes
by (13.1k points)

If you want your script to be ready and loaded before the page loads, you have to place it in the head tag. If you want the script to be available right before the user encounters something on the page you can put it in between the <body> and </body>

If your script does some enhancements or provides some tracking information place it before the </body> tag.

Want to be a full stack developer? Check out the full stack developer course from Intellipaat.

Browse Categories

...