$(document).ready(function(){ var outSec = 5, timeId = setInterval(function(){ if(outSec == 0){ clearInterval(timeId); $("#button").click(clickButton).val('点击按钮'); return; } $("#button").val('点击按钮('+outSec+')'); outSec -= 1; },1000) })