时间:2021-07-01 10:21:17 帮助过:39人阅读
$(function(){ //获取验证码 var getCode = document.getElementById('getCode'); var wait = 60; function time(btn){ if (wait===0) { btn.removeAttribute("disabled"); btn.innerHTML = "获取验证码"; wait = 60; }else{ btn.setAttribute("disabled",true); btn.innerHTML = wait + "秒后重试"; wait--; setTimeout(function(){ time(btn); },1000); } } getCode.onclick = function(){ time(this); }; })
以上就是js 短信倒计时60s的方法的详细内容,更多请关注Gxl网其它相关文章!