首页 > 设计 > WEB开发 > 正文

JS实现发送验证码进行倒计时

2019-11-02 18:23:11
字体:
来源:转载
供稿:网友

       

  var wait = 120;

        function time(o) {            if (wait == 0) {                o.removeAttribute("disabled");                o.value = "免费获取验证码";                wait = 5;            } else {                              o.setAttribute("disabled", true);                o.value = "重新发送(" + wait + ")";                wait--;                setTimeout(function () {time(o) },1000)            }        }
上一篇:DES3加解密问题

下一篇:30.滚动监听

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表