Countdown timer

Here's a simple countdown timer for the screen using a DIV instead of HTML field
HTML • JavaScript


<div id="countbox"></div>

<script> 
var seconds=5 
function display(){ 
	if (seconds<=-1){ 
    	seconds+=1 
 	} else {
    	seconds-=1 
    	document.getElementById('countbox').innerHTML=seconds
    	setTimeout("display()",1000) 
	}
}

display();

</script> 

Written by Frank Joseph Brefere III

Posted by fbrefere001 on Thursday October 11, 2007