网页中15秒后重新发送验证码,多少秒后发送验证码
//按钮禁用15s $("#captchaBtn").attr("disabled","disabled"); var time=15; window.setTimeout("tick("+time+")",1000);
function tick(time) { //var time = new Number(document.getElementById("Button1").value); if(time>0) { $("#captchaBtn").text((time--)+"秒后重新发送"); window.setTimeout("tick("+time+")",1000); } else { document.getElementById("captchaBtn").disabled = false; $("#captchaBtn").text("获取验证码"); } }