PHP
·
发表于 5年以前
·
阅读量:8410
<input id="send" type="button" value="发送验证码">
var times = 60, // 临时设为60秒
document.getElementById('send').onclick = function () {
timer = setInterval(function () {
times--;
if (times <= 0) {
send.value = '发送验证码';
clearInterval(timer);
send.disabled = false;
times = 60; }
else {
send.value = times + '秒后重试';
send.disabled = true;
}
}, 1000);
}