krisdc
05-24-2004, 03:32 AM
The purpose of my code is to make a countdown form 10 to 0 in window.status by clicking a button.
I've want it to count 1 down every second. But it goes straight to 0 :confused:
I really don't know what i'm doint wrong. I'm just a simple student who needs to know this for his exams. Can anyone help me? I've tried almost everything.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
<!--
var teller=10;
function aftellen()
{
while (teller>0)
{
setTimeout("window.status=teller",1000);
teller=teller-1;
}
}
//-->
</script>
</head>
<body>
<input type="button" value="knop1" onClick="aftellen()";>
</body>
</html>
I've want it to count 1 down every second. But it goes straight to 0 :confused:
I really don't know what i'm doint wrong. I'm just a simple student who needs to know this for his exams. Can anyone help me? I've tried almost everything.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
<!--
var teller=10;
function aftellen()
{
while (teller>0)
{
setTimeout("window.status=teller",1000);
teller=teller-1;
}
}
//-->
</script>
</head>
<body>
<input type="button" value="knop1" onClick="aftellen()";>
</body>
</html>