zoukankan      html  css  js  c++  java
  • 考试系统中的倒计时(JavaScript)

    <script type="text/javascript">
        var myTimeOut=document.forms[0].txtLimt.value*1;
            var sec=30;
        window.attachEvent("onload",myTimer);
        function myTimer(){
        if(sec==00)
        {
            sec=59;
            myTimeOut-=1;
          
        }
        else
        {
            sec-=1;
        }
        document.forms[0].RemainTime.value=myTimeOut+":"+sec;
        if(myTimeOut==0&&sec==0)
        {
           document.getElementById("ibtOver").click();
        }
        window.setTimeout("myTimer()",1000);
        }
        </script>
    Top
    收藏
    关注
    评论
  • 相关阅读:
    Java's Volatile Keyword
    reflection
    Spring
    Stack
    Set
    Vector & ArrayList
    CreateFileDemo
    session原理
    multithreadingDemo
    REST风格
  • 原文地址:https://www.cnblogs.com/judypol/p/1547136.html
Copyright © 2011-2022 走看看