Skip to content
Related Articles

Related Articles

Improve Article

HTML | <script> async Attribute

  • Last Updated : 13 Apr, 2021

The HTML,<script> async attribute is a boolean attribute. When present, it specifies that the script will be executed asynchronously when it is available. This attribute only works for external scripts (and used only in when src attribute is present ).
Note: There are so many ways in which external script execute: 

  • when async is present: The script is executed asynchronously with the rest of the page (the script will be executed while the page continues the parsing)
  • when async is not present and defer is present: The script is executed when the page has finished parsing
  • If neither async or defer is present: The script is fetched and executed immediately before the browser continues parsing the page


<script async>

Example: Index.html 


<!DOCTYPE html>
        <h1 style="color:green">
        <p id="p1">Hello GFG</p>
        <script src="geeks.js" async></script>



alert("Hello GFG"); 


Supported Browsers:The browsers supported by HTML <script> async attribute are listed below 

  • Google Chrome 4.0
  • Firefox 4.0
  • Apple Safari 4.0
  • Opera 10.5
  • Edge


Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML  course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :