HTML 5: The Markup Language (ARIA Edition)

scriptembedded script # T

The script element dynamic script and data blocks to be included in documents.

Content model #

script.elem.embedded =
non-replaceable-character-data & script.attrs.embedded
script.elem.imported =
empty & script.attrs.imported

Attribute model #

script.attrs.embedded =
common.attrs & type? & language?
script.attrs.imported =
common.attrs & src & defer? & async? & type? & charset? & language?

Element-specific attributes #

type = mimetype
The language of the script or format of the data.
language = javascript
Specifies that the language of the script is JavaScript.
src = uri
The address of the external script to use.
defer = "defer" | ""
Specifies that script should be executed after the document has been parsed.
async = "async" | ""
Specifies that the script should be executed asynchronously, as soon as it becomes available.
charset = charset
The character encoding of the external script.

Assertions #

Tag omission #

A script element must have both a start tag and an end tag.

Permitted contexts #

Typical default display properties #

script {
display: none; }