HTML Element Attributes
Specifies whether a script should be evaluated asynchronously.
Inline |
<element async ... > |
Script |
object.async = true | false |
The property is read/write with a default value of false.
The async attribute is a boolean attribute, meaning its presence on an element represents true, and its absence represents false.
The behavior when async is present, depends on the script type.
For classic scripts, the script will be fetched in parallel to parsing and evaluated as soon as it is available ( potentially before parsing completes ).
For module scripts, the script and all its dependencies will be fetched in parallel to parsing, and the module script will be evaluated as soon as it is available ( potentially before parsing completes ).
async and defer both instruct the browser to download the script(s) in a separate thread, while the rest of the page ( the DOM, etc. ) is downloading, so the page loading is not blocked during the fetch process.
<script src="/example.js" async></script>
SCRIPT