JS简单的计时器
//显示学习计时器var hour = 0, minute = 0, second = 0;
var t = 0;
var flag1;
function studyTime()
{
hour=parseInt(t/60/60);
minute=parseInt(t/60%60);
second=parseInt(t%60);
document.getElementById('SECOND').innerHTML=second;
document.getElementById('HOUR').innerHTML=hour;
document.getElementById('MINUTE').innerHTML=minute;
t = t + 1;
flag1 = setTimeout("studyTime()", 1000);
}www.zzzyk.com
//终止学习计时器
function stopTime()
{
clearTimeout(flag1);
}
作者:pamchen
补充:web前端 , JavaScript ,