简单的防止表单重复提交
function myInterval(){ if(countDownTime==0){ $("#YanZhengMa").attr("disabled",false); $("#YanZhengMa").css("cursor","pointer"); $("#YanZhengMa").val("获取手机验证码"); clearInterval(timer); countDownTime = defaultCountDownTime; return; } $("#getYanZhengMa").val("重新获取("+countDownTime+"s)"); countDownTime--; } function countDown(){ countDownTime = defaultCountDownTime; $("#YanZhengMa").attr("disabled","disabled"); $("#YanZhengMa").css("cursor","auto"); timer = setInterval("myInterval()",1000); }