HTML async Attribute

HTML async Attribute is a boolean attribute which defines that the external script being used will be executed asynchronously once the script is available.

Syntax of HTML async Attribute

The Syntax of HTML async Attribute is shown below.

<script src="" async>
</script>

Usage of HTML async Attribute

HTML async Attribute is used to specify the asynchronous nature of external script. It means that script will be executed during the page parsing.

It is only used for external scripts.

It is only used when src attribute is defined.

Used For

HTML async Attribute is used for following tags.

Tag Name
HTML script Tag

Example of HTML async Attribute

Simple example of HTML async Attribute is given below.

<script src="external-script.js" async>
</script>

In above example we have used HTML async Attribute for external script file named external-script.js.

Values of HTML async Attribute

Following values can be used with HTML async Attribute.

ValueDescription
asyncDefines that script is asynchronous

Note: async="async" and only async both are used.

Browser Support for HTML async Attribute

HTML async Attribute is supported by following major browsers.

Browser NameVersion
ChromeAll
Firefox3.6 and above
OperaAll
IE / Edge10.0 and above
SafariAll