HTML - attributes - async

revision:


Content

"async" attribute is a boolean attribute. syntax some examples


"async" attribute is a boolean attribute.

top

If it is set, the script is downloaded in parallel to parsing the page and executed as soon as it is available.
The parsing of the page is interrupted once the script is downloaded completely, and then the script is executed, before the parsing of the rest of the page continues.
The async attribute is only for external scripts (and should only be used if the src attribute is present).


syntax

top

<script async>


some examples

top

Hello World!

codes:
                    <p id="p1">Hello World!</p>
                    <script src="demo_async.js" async></script>
                

How do you do!

codes:

                    <p id="p1">How do you do! </p>
                    <script async src="script.js"></script>