码迷,mamicode.com
首页 > Web开发 > 详细

jQuery 发送验证码倒计时按钮 复制代码

时间:2014-11-05 16:20:10      阅读:132      评论:0      收藏:0      [点我收藏+]

标签:blog   io   ar   java   sp   div   on   log   cti   

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script src="../scripts/jquery.js" type="text/javascript"></script>
    <script>
        $(function () {
            var util = {
                wait: 90,
                hsTime: function (that) {
                    _this = $(this);
                    if (_this.wait == 0) {
                        $(‘#hsbtn‘).removeAttr("disabled").val(‘重发短信验证码‘);
                        _this.wait = 90;
                    } else {
                        var _this = this;
                        $(that).attr("disabled", true).val(‘在‘ + _this.wait + ‘秒后点此重发‘);
                        _this.wait--;
                        setTimeout(function () {
                            _this.hsTime(that);
                        }, 1000)
                    }
                }
            }
            util.hsTime(‘#hsbtn‘);
            $("#hsbtn").click(function(){
                util.hsTime(‘#hsbtn‘);
            })
        })
    </script>
</head>
<body>
<input type="button" id="hsbtn" />
</body>
</html>

 

jQuery 发送验证码倒计时按钮 复制代码

标签:blog   io   ar   java   sp   div   on   log   cti   

原文地址:http://www.cnblogs.com/sntetwt/p/4076389.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!