Count down timer : Timer « Animation « JavaScript Tutorial






<html>
<head>
<title>A Simple Page</title>
<meta http-equiv="refresh" content="30">
<script language="JavaScript">
<!--
var x=30;
var y=1;
function startClock(){
    x=x-y;
    document.form1.clock.value = x;
    timerID=setTimeout("startClock()", 1000);
}
//  -->
</script>
</head>
<body onload="startClock()">
<form name="form1">
<input type="text" name="clock">
</form>
</body>
</html>








31.4.Timer
31.4.1.Count down timer
31.4.2.Jtween animation