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: | |
---|---|
Attribute | Description |
name | Defines the name of the parameter. |
src | Specifies a URI/URL of an external script. |
type | Specifies the scripting language as a content-type (MIME type). |
language | Specifies the scripting language, however, this attribute has been deprecated. Use the type attribute instead. |
defer | Declares 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: | |
Attribute | Description |
charset | Defines 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.