<script> HTML Tag

What does <script> HTML Tag do?
The <script> element contains code written in a programming language other than HTML or specifies the location of an external script resource. It is most commonly used to add JavaScript and jQuery to webpages either directly or by linking to external .js files.

Empty or Not?

The <script> element has two potential uses. It can define a section of the page written in a scripting language other than HTML. It can also import a script from an external file. In the latter case, the <script> element must have no content.

Default Behavior

By default, the browser will load and run the script while the rest of the content is loading. You can control this using the defer attribute, which forces the browser to finish loading the page first.

Claire is an HTML enthusiast.

Browser Support for script