[转载]获取验证码60秒倒计时

 var countdown = 60;
        function settime() {
            var val = $("#<%=this.btnGetCode.ClientID %>");
            if (countdown == 0) {
                val.removeAttr("disabled");
                val.val("获取验证码");
                countdown = 60;
                return;
            }
            else {
                val.attr("disabled", true);
                val.val("重新发送(" + countdown + ")");
                countdown--;
            }
            setTimeout(function() {
                settime(val)
            }, 1000)
        }

posted on 2017-12-14 11:47  New_q  阅读(105)  评论(0编辑  收藏  举报

导航