input type="button" id="btn" value="发送短信"script type="text/javascript" src="/jquery/jquery.js" var count_time= 60;//定义规定的时间,60秒后再次发送 function start_timer() { if(count_time == 0) { $('#btn').removeAttr("di
<input type="button" id="btn" value="发送短信"> <script type="text/javascript" src="/jquery/jquery.js"> var count_time= 60;//定义规定的时间,60秒后再次发送 function start_timer() { if(count_time == 0) { $('#btn').removeAttr("disabled"); $('#btn').val("重新发送"); count_time= 60; }else { $('#btn').attr("disabled",true); $('#btn').val("重新发送("+count_time+")"); count_time--; setTimeout(function(){start_timer();},1000); } } $('#btn').click(function(){ start_timer(); }); </script>