i = 0;
function start(){
sobj = setInterval(function () {
document.title = ++i;
},1000)
}
function stop(){
clearInterval(sobj);
}
start();
stopobj = document.getElementById('start');
starobj = document.getElementById('stop');
stopobj.onclick = function(){
start();
}
starobj.onclick = function () {
stop();
}
JS-计数器
最新推荐文章于 2024-05-22 21:15:32 发布