$('.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);})