I cant seem to get this too work –
here is the original code – i want it count 30-0 then repeat 30-0 firing an alert 1 and an alert 2 reaching 0
promblem is it doesnt auto start counting
i just want the buttons to stop count and restart count
where you stopped it (ie 15 it will restart counting at 15 )
<html>
<head>
<script type=”text/javascript”>
var c=0;
var t;
var timer_is_on=0;
function timedCount()
{
document.getElementById(‘txt’).value=c;
c=c+1;
t=setTimeout(“timedCount()”,1000);
}
function doTimer()
{
if (!timer_is_on)
{
timer_is_on=1;
timedCount();
}
}
function stopCount()
{
clearTimeout(t);
timer_is_on=0;
}
</script>
</head>
<body>
<form>
<input type=”button” value=”Start count!” onclick=”doTimer()” />
<input type=”text” id=”txt” />
<input type=”button” value=”Stop count!” onclick=”stopCount()” />
</form>
</body>
</html>