d d d d d d
var maxtime = 1 * 60; // function CountDown() { if (maxtime >= 0) { minutes = Math.floor(maxtime / 60); seconds = Math.floor(maxtime % 60); msg = “距离结束还有” + minutes + “分” + seconds + “秒”; document.all[“timer”].innerHTML = msg; –maxtime; } else{ clearInterval(timer); } } timer = setInterval(“CountDown()”, 1000);
转载请注明:无趣的人生也产生有意思的事件 » 简单实用的倒计时JS