zoukankan      html  css  js  c++  java
  • 怎样让一个页面的数字重新反复显示

    让页面的一个数字反复的显示,可以用刷新的方法。

    具体的代码如下:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>延时</title>

    <script type="text/javascript">
        
        var number = 5;
        function Display()
        {
            
            var num = document.getElementById("number_display");
            number--;
            num.value = number;  
            if(number==0)
            {
               location.href=location.href;
            }
            setTimeout("Display()",1000);

        }
    </script>
    </head>

        
    <body  onload="Display()">
        <input type="text" id="number_display"/>
    </body>
    </html>

  • 相关阅读:
    自我学习笔记08
    自我学习笔记07
    自我学习笔记06
    自我学习笔记05
    自我学习笔记04
    自我学习笔记03
    自我学习笔记02
    WebApi HttpUtils
    Android 正则表达式,Pattern,Matcher基本使用
    Andriod项目结构
  • 原文地址:https://www.cnblogs.com/selfimprove/p/3152391.html
Copyright © 2011-2022 走看看