Code:
<html>
<head>
<script type="text/javascript">
function timedText()
{
document.getElementById('displayDiv').innerHTML='';
var t1=setTimeout("document.getElementById('displayDiv').innerHTML='2 seconds!'",2000);
var t2=setTimeout("document.getElementById('displayDiv').innerHTML='4 seconds!'",4000);
var t3=setTimeout("document.getElementById('displayDiv').innerHTML='6 seconds!'",6000);
}
</script>
</head>
<body>
<form>
<input type="button" value="Display timed text!" onClick="timedText()">
<div id="displayDiv">
<p>Click on the button above. It will tell you when two, four, and six seconds have passed.</p>
</div>
</body>
</html>