HTML element: <script>
The <script> element defines a script, such as a JavaScript®. The script may be enclosed within the element, or may reference an external script.
Attributes
Attribute |
Value(s) |
Description |
Availability |
|---|---|---|---|
charset |
charset |
This attribute specifies the character encoding used in the script. |
4.6 or later |
defer |
— |
When specified, this attribute indicates that the script does not generate any document content. |
4.0 or later |
language |
script_language |
Deprecated. This attribute specifies the scripting language. |
4.0 or later |
src |
URL |
This attribute specifies the URI where an external script document is located. |
4.0 or later |
type |
text/emcascript text/javascript application/ecmascript application/javascript |
Required. This attribute specifies the MIME type of the script. |
4.0 or later |