<div style="float: right;">
Time Remaining
<b id="min">0</b> minute(s)
<b id="sec">0</b> second(s)
</div>
<script>
dm=0;dd=5;
function remaining(){
if(dd>=0){
if(dm<0){
alert('time is out');
}else{
document.getElementById('min').innerHTML=dm;
document.getElementById('sec').innerHTML=dd;
if(dd<=0){
dd=60;
dm--;
}
dd--;
setTimeout('
remaining
()',1000);
}
}
}
remaining
(); </script>
No comments:
Post a Comment