async/defer attributes and DOM construction

3. script with async

Result

Hello World!

Markup

<p id="result">
    Hello
    <script src="A.js" async defer></script>
    <script src="B.js" async defer></script>
    <script src="C.js" async defer></script>
    World!
</p>

DOM elements and Events

Description

The browser that supports async attribute will asynchronously load and execute the script with async as soon as possible. Since the execution order of the scripts are not kept, this attribute can not be specified in the scripts that have dependencies each other.