zoukankan      html  css  js  c++  java
  • 显示倒计时,为零时自动点击按钮提交【JavaScript实现】

    原文发布时间为:2008-10-17 —— 来源于本人的百度文章 [由搬家工具导入]

    <html>
    <head>
    <title>显示倒计时,完毕提交</title>
    <script language="JavaScript">      
    function   testTime()   {  
          if(sec==-1){
                 min--;
            if(min!=-1)
                 sec=59;
            else
               document.getElementById("button1").click();
          }           
          if(sec>=0)
               document.getElementById("showTime").innerHTML = "<font color=red>"+timeFormat

    (min)+" : "+timeFormat(sec)+"</font>";   
          sec--;
    }

    function timeFormat(time){
         if(time<10)
             return "0"+time;
         else
             return time;
    }

    function showTime(){
          if(document.all)
    setInterval("testTime()",1000);
    }
    </script>
    </head>
    <body onload="min=1;sec=12;showTime()">
    <span   id="showTime"></span>
    <br></br>
    <button id="button1" OnClick=alert('时间到,自动提

    交!');window.location.href="http://www.baidu.com">提交</button>
    </body>
    </html>

  • 相关阅读:
    Python的运算符
    RabbitMQ 的配置文件
    安装新版本的rabbitmq
    Ubuntu 16.04 安装rabbitmq
    Python Web 版本tailf, grep
    解决pycharm问题:module 'pip' has no attribute 'main'
    Python argparse
    Ansible 并行和异步
    cef相关
    浏览器透明设置例子,qt5.6才支持
  • 原文地址:https://www.cnblogs.com/handboy/p/7148483.html
Copyright © 2011-2022 走看看