码迷,mamicode.com
首页 > 其他好文 > 详细

获取验证码

时间:2017-02-10 14:49:14      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:ble   oct   val   time   title   html   text   move   round   

获取验证码倒计时:

<!DOCTYPE html>
<html>
<head>
    <title>获取验证码倒计时</title>
</head>
<body>
<input id="btn"  value="获取验证码" onclick="time(this);">
<script type="text/javascript">
    var wait = 60;
    document.getElementById("btn").disabled = false;
    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);
        }
    }
</script>
</body>
</html>

 

获取验证码

标签:ble   oct   val   time   title   html   text   move   round   

原文地址:http://www.cnblogs.com/wang715100018066/p/6385996.html

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