首页 > 代码库 > 获取短信验证码倒计时
获取短信验证码倒计时
- <input type="button" id="btn" value=http://www.mamicode.com/"免费获取验证码" />
- <script type="text/javascript">
- var wait=60;
- function time(o) {
- if (wait == 0) {
- o.removeAttribute("disabled");
- o.value=http://www.mamicode.com/"免费获取验证码";
- wait = 60;
- } else {
- o.setAttribute("disabled", true);
- o.value=http://www.mamicode.com/"重新发送(" + wait + ")";
- wait--;
- setTimeout(function() {
- time(o)
- },
- 1000)
- }
- }
- document.getElementById("btn").onclick=function(){time(this);}
- </script>
获取短信验证码倒计时
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。