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时间问题,可以参考此处。。。

    珍惜现在,珍惜每一分,每一秒。 从不放弃,坚持。。。。。
  • 相关阅读:
    js加载优化三
    js加载优化-二
    js加载优化
    怎样获取元素的高度
    HttpClient
    Android Http请求方法汇总
    table列等宽
    单页面手机开发
    单页面
    【154】C#打包程序成安装包
  • 原文地址:https://www.cnblogs.com/feiguo/p/3682081.html
Copyright © 2011-2022 走看看