标签:
倒计时 59 秒:
var c=59 var t function timedCount() { document.getElementById(‘txt‘).value=c if(c>0){ c--; }else{ clearTimeout(t); } t=setTimeout("timedCount()",1000) } </script>
计时器设置一个时钟:
function startTime() { var today=new Date() var h=today.getHours() var m=today.getMinutes() var s=today.getSeconds() m=checkTime(m) s=checkTime(s) document.getElementById(‘txt‘).innerHTML=h+":"+m+":"+s t=setTimeout(‘startTime()‘,500) } function checkTime(i) { if (i<10) {i="0" + i} return i }
标签:
原文地址:http://www.cnblogs.com/ingstyle/p/4207762.html