Last Updated : 02 Jun, 2022
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:
Syntax:
<script async>
Example: Index.html
<!DOCTYPE html>
<html>
<body>
<center>
<h1 style="color:green">
Geeksforgeeks
</h1>
<p id="p1">Hello GFG</p>
<script src="geeks.js" async></script>
</center>
</body>
</html>
geeks.js
Output:
Supported Browsers: The browsers supported by HTML <script> async attribute are listed below
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4