首页 > 其他 > 详细

获取验证码按钮点击后,一分钟内不可继续点击

时间:2016-04-15 11:41:44      阅读:354      评论:0      收藏:0      [点我收藏+]
 1 <input type="button" id="btn" value="免费获取验证码" />  
 2 <script type="text/javascript">  
 3     var wait=60;  
 4     function time(o) {  
 5         if (wait == 0) {  
 6             o.removeAttribute("disabled");            
 7             o.value="免费获取验证码";  
 8             wait = 60;  
 9         } else {  
10             o.setAttribute("disabled", true);  
11             o.value="重新发送(" + wait + ")";  
12             wait--;  
13             setTimeout(function() {  
14                 time(o)  
15             },  
16             1000)  
17         }  
18     }  
19     document.getElementById("btn").onclick=function()
20     {time(this);}
21 </script>

 

获取验证码按钮点击后,一分钟内不可继续点击

原文:http://www.cnblogs.com/grnBlogs/p/5394699.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!