Easy Tutorial
❮ Prop Win Parent Prop Win Innerheight ❯

async Attribute for Script

Script Object

Example

Check if the script executes asynchronously (as soon as it is available):

x Output result is:


Definition and Usage

The async attribute sets or returns whether the script executes asynchronously (as soon as it is available).

This attribute reflects the async attribute of the <script> tag.

Note: The async attribute is only applicable to external scripts (only when the src attribute is used).

Note: There are several ways to execute external scripts:


Browser Support

All major browsers support the async attribute.

Note: IE 9 and earlier versions, and Opera 12 and earlier versions do not support the async attribute.


Syntax

Return the async attribute:

Set the async attribute:

Attribute Values

Value Description
true/false Specifies whether the script executes asynchronously (as soon as it is available). true - The script will be executed asynchronously as soon as it is available. false - The script will not be executed asynchronously (as soon as it is available).

Technical Details

| Return Value: | Boolean, returns true if the script executes asynchronously (as soon as it is available), otherwise returns false. |


Related Articles

HTML Reference: HTML <script> async Attribute


Script Object

❮ Prop Win Parent Prop Win Innerheight ❯