js获取验证码倒计时

<button type="button" id='getting' onclick="time(this)" class="mui-btn text-primary" style="height: 40px;width:30%;">获取验证码</button>

 //倒计时
 var wait = 60;
 function time(btnObj) {
     if(wait == 0) {
         btnObj.removeAttribute("disabled");
         btnObj.textContent = "重新发送";
         wait = 60;
     } else {
         btnObj.setAttribute("disabled", true);
         btnObj.textContent = wait + "秒";
         wait--;
         setTimeout(function() {
             time(btnObj)
         }, 1000)
     }
 }

 

上一篇:【Flink】Flink flink-runtime.version.properties generated correctly. You MUST run mvn generate-source


下一篇:find命令总结