zoukankan      html  css  js  c++  java
  • javaScript 验证码 倒计时60秒

    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(){time(this);}  
    20. </script>  
  • 相关阅读:
    [USACO12FEB]牛券Cow Coupons
    合并果子
    序列合并
    中位数
    道路游戏
    教主的花园
    摆花
    hello world之Makefile
    mysql+tomcat+spring 配置心得(从0开始搭环境)
    C#,.Net自动生成大写字母编码
  • 原文地址:https://www.cnblogs.com/liqiong-web/p/7660837.html
Copyright © 2011-2022 走看看