tinernet
07-09-2003, 06:11 AM
I want to make a timer countdown for my puzzle website that counts down 90 seconds. At the moment I have a setTimeout function in body onload but due to the nature of the website I want the user to be able to see how long they left. Can anyone help? It should be really simple.
requestcode
07-09-2003, 06:53 AM
Something like this:
<html>
<head>
<title>Count Down Display</title>
<script language="JavaScript">
counter=90
function timerdis()
{
counter--
document.myform.disp.value=counter
if(counter>0)
{setTimeout("timerdis()",1000)}
else
{window.status="All done!"}
}
setTimeout("timerdis()",1000)
</script>
</head>
<body>
<form name="myform">
<input type="text" name="disp" size="2" value="90">
</form>
</body>
</html>