async/defer attributes and DOM construction

7. script with defer (IE fix)

Result

Hello World!

Markup

<p id="result">
    Hello
    <script src="X.js" defer></script>
    <script src="Y.js" defer></script>
    <script src="Z.js" defer></script>
    World!
</p>

DOM elements and Events

Description

In the Issue #42 at H5BP community, some workarounds can be found, but no one was succeed avoiding the bug.

Unfortunately, I also could not fix the case of jquery.js and jquery-ui.js (H5BP comunity already decided not to attach defer attributes with these scripts), but can fix my little demo with very straightforward way as follows:

var e = document.createElement('span');
e.innerHTML = 'X';
document.getElementById('result').appendChild(e);