References

Collection of references for web development.

HTML script tag

Description

The HTML <script> element represents client-side script (JavaScript).

Attributes

Attribute Value Description
async boolean Specifies if the script is executed asynchronously.
crossorigin anonymous
use-credentials
Allow data from third-party websites that allow cross-origin access so you can reuse it.
defer boolean Specifies if the script should execute when the document has finished parsing.
integrity metadata Specifies inline metadata that the browser checks for manipulation.
nonce string Specifies the number used once to white-list for the scripts policy.
src URL The URL of the file to embed in the document.
text string Specifies the text for the element.
type MIME type Specifies the media type for the URL.

Example

<script>document.write("Hello World!");</script>