页面js代码
//倒计时
var wait = 60;
function time(btnObj) {
if (wait == 0) {
btnObj.removeAttribute("disabled");
btnObj.textContent = "再次获取验证码";
wait = 60;
} else {
btnObj.setAttribute("disabled", true);
btnObj.textContent = "重新发送验证码(" + wait + "s)";
wait--;
setTimeout(function() {
time(btnObj)
},1000)
}
}