<script> Attributes: async
<script> tag has an
async attribute that mirrors the
async property of the
async attribute is a boolean attribute. What this means is it doesn't have a value, it just needs to be present. If the
async attribute is present, then the script will run asynchronously. If a script is running asynchronouly, then it means that other things can be running at the same time. The
async attriute causes the browser to run the script as soon as possible, but not to block document parsing while the script is being downloaded. Asynchronous scripts run as they load which means that they can execute out of order (compared to deferred scripts which run in the order in which they appear in the document).
async attribute is not present (and neither is a
defer attribute), then the script will not run asynchronously. It will run synchronously (the default, also called a blocking script).
According to the HTML5 standard, the
defer attribute and the
async attribute can only be used when the
src attribute is used. Some browsers may support deferred inline scripts. If both the
defer attributes are present, the browser will use the
async attribute and ignore the