zoukankan      html  css  js  c++  java
  • 倒计时获取手机验证码

    <!DOCTYPE html>
    <html lang="en">
        <head>
    <meta charset="utf-8">
            <style>
                input{
                    outline: none;
                    border: 1px solid #ccc;
                    border-radius: 5px;
                    padding: 5px 10px;
                    background-color: #fff;
                    color: #444;
                }
            </style>
            <script src='common.js'></script>
            <script type="text/javascript">
                window.onload = function(){
                    $id('send').onclick = function(){
                        var count = 5;
                        if(this.timer){
                            clearInterval(this.timer);
                        }
                        var that = this;
                        this.timer = setInterval(function(){
                            that.value = '还剩' + count + '秒';
                            count--;
                            that.style.backgroundColor = 'skyblue';
                            that.style.color = '#fff';
                            that.disabled = true;
                            if(count < 0){
                                clearInterval(that.timer);
                                that.value = '点击重新发送验证码';
                                that.style.backgroundColor = '#fff';
                                that.style.color = '#444';
                                that.disabled = false;
                            }
                        }, 1000);


                    }
                }
            </script>
        </head>
        <body>
            <input type="text" >
            <input type="button" id="send" value="点击获取手机验证码">
        </body>
    </html>
  • 相关阅读:
    小四学习系列教程
    SQL分组多列统计(GROUP BY后按条件分列统计) -转
    fdisk:command not found
    PWA最简单例子
    Rider 2017.1.1下跑AVD出现Unexpected schema version 3错误的解决方法
    困扰:C#.net 连接Oracle11g 不报错但是在connection时出现 ServerVersion 引发了“System.InvalidOperationException”类型的异常
    JQuery EasyUI datagrid 复杂表头处理
    sql server 与oracle 中字段类型的对应
    Oracle 11g导出空表、少表的解决办法
    JS组件系列——两种bootstrap multiselect组件大比拼
  • 原文地址:https://www.cnblogs.com/mmit/p/11268743.html
Copyright © 2011-2022 走看看