Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
<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<body>
<div id="main">The number will be increased and displayed here every 3 seconds
<seconds</div>
</body>
</html>