javascripttech.blogspot.com

Mixing up the order of our sequential code also mixes up the order of our output.

HTML

<body>
    <p id="result"></p>
</body>

JavaScript

document.getElementById('result').innerHTML += ('starting ...');
document.getElementById('result').innerHTML += ('ending!');
document.getElementById('result').innerHTML += ('continuing ...');