<!doctype html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> ...
<!doctype html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style> #btnyzm { background: #31BCFF; color: #fff; font-size: 14px; padding: 0; line-height: 43px; border-radius: 0; border: 0; width: 50%;}.btn_com:disabled { background-color: #999999 !important;} </style></head><body> <input type="button" class="btn_com" id="btnyzm" value="发送验证码"><script type="text/javascript"> var wait=60; function time(o) { if (wait == 0) { o.removeAttribute("disabled"); o.value="发送验证码"; wait = 60; } else { o.setAttribute("disabled", true); o.value="(" + wait + ")后可重新发送"; wait--; setTimeout(function() { time(o) }, 1000) } } document.getElementById("btnyzm").onclick=function(){time(this);} </script></body></html>
效果实现图
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:js实现发送验证码倒计时效果
关键词:JS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。