1var count = 15;
2var interval = setInterval(function(){
3 document.getElementById('count').innerHTML=count;
4 count--;
5 if (count === 0){
6 clearInterval(interval);
7 document.getElementById('count').innerHTML='Done';
8 // or...
9 alert("You're out of time!");
10 }
11}, 1000);