zoukankan      html  css  js  c++  java
  • js 计时器

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>js15.html</title>
        
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="this is my page">
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        
        <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
    
        <script type="text/javascript">
        
        var sec = 0;
        var timeId = setInterval("count();", 1000);
        
        function count()
        {
            document.getElementById("num").innerHTML = sec++;
        }
        
        function stopCount()
        {
            clearInterval(timeId);
        }
        
        </script>
    
      </head>
      
      <body>
        
        <font color="red" id="num">0</font>秒钟
        
        <input type="button" value="停止" onclick="stopCount();">
        
    </html>

    各种javascript时间问题,可以参考此处。。。

    珍惜现在,珍惜每一分,每一秒。 从不放弃,坚持。。。。。
  • 相关阅读:
    CSP游戏 4
    CSP 交通规划
    CSP 地铁修建
    CSP 通信网络
    CSP URL映射
    CSP 权限查询
    CSP Markdown
    CSP JSON 查询
    SQL里的子查询
    SQL里的操作符
  • 原文地址:https://www.cnblogs.com/feiguo/p/3682081.html
Copyright © 2011-2022 走看看