标签:clear interval var set tin time() 计时 click pre
$(‘.btn‘).click(function(){
var newTime = 60;
var time = function(){
newTime--;
$(‘.btn‘).val(+newTime+"秒");
if(newTime == 0){
clearInterval(timer);
$(‘.btn‘).val("重新获取");
}
}
time();
var timer = setInterval(time,100);
})
标签:clear interval var set tin time() 计时 click pre
原文地址:http://www.cnblogs.com/yanxiaoyanyan/p/6178721.html