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

发送验证码倒计时

时间:2014-11-20 18:16:55      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   ar   color   sp   on   div   

bubuko.com,布布扣bubuko.com,布布扣

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>淘宝倒计时</title>
<script>
window.onload=function(){
    var oBut=document.getElementById(but);
    var oName=oBut.value;
    var timer=null;
    but.onclick=function(){
        var n=5;
        clearInterval(timer);
        timer=setInterval(function(){
            //oName=‘秒后重新发送‘;
            //alert(‘oo‘);
            //alert(n--);
            oName=n--+秒后重新发送;
            //alert(oName)
            oBut.value=oName;
            if(n==0)
            {
                //alert(‘ok‘);
                clearInterval(timer);
                oBut.value=免费获取验证码;
            };
        },1000);
    };
};
</script>
</head>

<body>
<input id=‘but‘ type="button" value="免费获取验证码">
</body>
</html>

 

发送验证码倒计时

标签:style   blog   http   io   ar   color   sp   on   div   

原文地址:http://www.cnblogs.com/heboliufengjie/p/4111120.html

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