<div id='numDiv'>10</div><script type="text/javascript">var num=10;var interval=setInterval(function(){if(num==0){clearInterval(interval);}numDiv.innerHTML=num--;},1000);</script>