<div class="box">
<h2>剩余时间:<span class="clock">60</span>秒</h2>
</div>
<button>点击</button>
var timeClock;
function sendCode() {
var timer_num = 60;
timeClock=setInterval(function(){
timer_num--;
$('.clock').html(timer_num);
if (timer_num == 0) {
clearInterval(timeClock);
$('.clock').html(60);
}
},1000)
}
$("button").click(function(){
sendCode();
})