waitFor.html
772 Bytes
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>waitFor test</title>
</head>
<body>
<img src="images/phantom.png"/>
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
<div id="textChange" >
Loading...
</div>
<div id="encoded">Voilà</div>
<script>
setTimeout(function() {
var li = document.createElement('li')
li.appendChild(document.createTextNode('four'));
document.querySelector('ul').appendChild(li);
document.getElementById('textChange').innerHTML = 'Done';
}, 500);
</script>
</body>
</html>