var wait=59;
function time(){
if(wait >= 0){
$("#buttons").val("" + wait + "s重新发送");
wait--;
setTimeout(function() {
time()
},1000)
}else{
$("#buttons").hide();
$("#button").show();
wait=59;
}
};
$("#button").click(function(){
$(this).hide();
$("#buttons").show();
time()
});
原文:http://www.cnblogs.com/xupeiyu/p/4602820.html