HTML DOM Script async Property Last Updated : 20 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The DOM Script async property is used to set or return whether a script should be executed asynchronously or not. This property is used to reflect the async attribute. This attribute only works for the external script. There are the following ways that the external script could be executed: The script will be executed asynchronously with the rest of the page when async is present. This means while the page continues the parsing the time script will be executed.If the defer is present but async is not present then the script will be executed when the page has finished parsing.If both, async or defer is not present then the script is fetched and will execute immediately, even before the browser continues parsing the page. Syntax: It returns the async property.scriptObject.asyncIt is used to set the async property.scriptObject.async = true|false Property Values: It contains a Boolean value which specifies that whether the script should be executed asynchronously as soon as it is available, or not. True: It specifies that the script should be executed asynchronously.false: It specifies that the script will not be executed asynchronously. By default, it is set to false. Return Value: It returns a Boolean value that specifies whether the script should be executed asynchronously or not. Example: In this example, we will use the DOM Script async Property. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Script async Property </title> </head> <body style="text-align:center;"> <h1 style="color:green;"> GeeksforGeeks </h1> <h2> DOM Script async Property </h2> <p id="p1">Hello World!</p> <script id="myScript" src="demo_async.js" async> </script> <!-- Button that trigger the Function --> <button onclick="myFunction()"> Click me! </button> <p id="demo"></p> <!-- Main Function --> <script> function myFunction() { let x = document.getElementById("myScript").async; document.getElementById("demo").innerHTML = x; } </script> </body> </html> Output: Supported Browsers: The browser supported by HTML DOM Script async property are listed below: Google ChromeInternet Explorer 10.0FirefoxSafariOpera Comment More infoAdvertise with us Next Article HTML DOM Script async Property M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML Web technologies HTML-DOM Similar Reads HTML DOM Script charset Property The HTML DOM Script charset property is used to set or return the value of a charset attribute of an <script> element. The charset attribute is used to specify the character encoding used in an external script. Syntax: It returns the charset property. scriptObject.charsetIt is used to set the 2 min read HTML DOM Script defer Property The Script defer Property is used to set or return whether the script should be executed after the page has finished parsing. This Property is used to reflect the defer attribute of a <script> Tag. This attribute is only used for External JavaScript File. Syntax: It Returns the defer property. 1 min read HTML DOM Script src Property The DOM Script src Property is used to set or return the value of the src attribute of an <script> element. The src attribute specifies the URL of the External Javascript file. Syntax: It returns the src property:scriptObject.srcIt is used to set the src property:scriptObject.src = URL Propert 1 min read HTML DOM Script text Property The HTML DOM Script text Property is used to set or return the content of the <script> element. Syntax: It Returns the text property:scriptObject.textIt is used to set the text property:scriptObject.text = contents Property Values: It contains the value i.e contents that specify the content of 2 min read HTML DOM Script type Property The DOM Script type Property is used to set or return the value of the type attribute of a <script> element. The type attribute is used to specify the MIME type of a script. and identify the content of the <script> Tag. It has a Default value which is "text/javascript". Syntax: It is use 2 min read HTML | DOM Script Object The DOM Script Object is used to represent the HTML <script> element. The script element is accessed by getElementById(). Properties: async: It is used to specify the script is executed asynchronously. charset: It is used to specify the character encoding used in an external script file. defer 2 min read HTML DOM readyState Property The readyState property in HTML is used to return the loading status of the current document. This property is used for read-only. Syntax:document.readyStateReturn Value: It returns a string value which is used to define the status of the current document. The one of five status are listed below:uni 2 min read HTML DOM id Property The DOM id Property is used to set or return the id of an element i.e value of the Id Attribute. An ID should be different in a document. It is returned by using the document.getElementById() method. Syntax HTMLElementObject.id Return values: This syntax is used to return the id Property. HTMLElemen 2 min read HTML DOM window document Property The HTML DOM window document returns a reference to the document contained in the current window. Syntax: doc = window.document; Return Value: This property returns a reference to the document. Example: In this example, we will get the title of the document using that document reference. html <ti 1 min read Like