How would you set up a counter in javascript that goes from 5 to 0
This is what i have so far and it is not displaying in the div container "counter" for some reason...
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
#counter {border: 1px solid black; width: 100px; height: 100px; position: absolute; left: 450px; top: 10px;}
#leftcar {border: 1px solid black; width: 100px; height: 100px; position: absolute; left: 10px; top: 300px;}
#rightcar {border: 1px solid black; width: 100px; height: 100px; position: absolute; left: 800px; top: 300px;}
#explosion {border: 1px solid black; width: 100px; height: 100px; position: absolute; left: 450px; top: 300px;}
#controls {border: 1px solid black; width: 50px; height: 100px; position: absolute; left: 450px; top: 500px;}
</style>
<script>
function start () {
setContents ("counter",5);
var timer1= setTimeout("setContents('counter',4)",1000);
var timer2= setTimeout("setContents('counter',3)",2000);
var timer3= setTimeout("setContents('counter',2)",3000);
var timer4= setTimeout("setContents('counter',1)",4000);
var timer5= setTimeout("setContents('counter',0)",5000);
var timer6= setTimeout("setContents('counter',Go)",6000);
}
</script>
</head>
<body>
<div id="counter"></div>
<div id="explosion">
boom!
</div>
<div id="leftcar">
left car
</div>
<div id="rightcar">
right car
</div>
<div id="controls">
<form>
<input type="button" value="start" onclick="start();" />
<input type="button" value="reset" />
</form>
</div>
</body>
</html>[/HTML]