...
| Code Block | ||
|---|---|---|
| ||
<html>
<script>
var myCnt=0;
function alertFunc() {
myCnt++;
document.getElementById( "main").innerHTML = myCnt;
setTimeout(alertFunc, 3000); // repeat the same event
}
setTimeout(alertFunc, 3000);
</script>
<body><div id="main">>The number will be increased and displayed here every 3 seconds
</div>
</body>
</html> |