HTML 4 script Tag

Also see HTML5 <script> Tag.

This page is for the HTML 4 version of this element. For a more up to date version, see HTML5 <script> Tag.


The HTML script tag is used for declaring a script (such as JavaScript) within your HTML document.

Also see the HTML noscript tag for providing content to browsers that don't support your scripting language.

Example

Attributes

Attributes specific to this tag:
AttributeDescription
nameDefines the name of the parameter.
srcSpecifies a URI/URL of an external script.
typeSpecifies the scripting language as a content-type (MIME type).
languageSpecifies the scripting language, however, this attribute has been deprecated. Use the type attribute instead.
deferDeclares that the script will not generate any content. Therefore, the browser/user agent can continue parsing and rendering the rest of the page.
Other Attributes:
AttributeDescription
charsetDefines the character encoding that the script uses.

HTML5 Tags

The information on this page is based on HTML version 4.01. Most modern browsers now support HTML5.

See HTML5 <script> Tag for the HTML5 version of the above element.

See this list of HTML tags for the latest list of HTML elements.