倒计时60s短信 [记录]

//短信操作
var wait=60;
function time() {
var code = document.getElementById('code_send');
if (wait == 0) {
code.removeAttribute("disabled");
code.innerHTML="获取验证码";
wait = 60;
} else { // www.jbxue.com
code.setAttribute("disabled", true);
code.innerHTML="重新发送(" + wait + ")";
wait--;
setTimeout(function() {
time()
},
1000)
}
}

posted @ 2017-10-14 16:42  丶七月小先生丶  阅读(181)  评论(0编辑  收藏  举报