如何使JS柜台保存在VAR和DIV中



我的代码很难。除了var计数器和div不会更改其值,一切都很好,因为您可以在26上看到它。每次刷新我需要在网页上看到它,我需要查看我尝试在许多论坛上搜索的更新值网站等,但没有运气。

在这里您可以看到代码:

 <head>       
    <script type="text/javascript">
    var counter = 26.00  
    var timer;
    function countUP () {
        counter = counter + Math.random();
        document.getElementById("hugee").innerHTML =(counter).toFixed(5);
    }
    </script>
</head>
<body onLoad='timer = setInterval("countUP()", 5000);'>
   <div class="col-xs-9 text-right">
     <div class="huge" id="hugee">26.00</div>
   </div>
</body>
only wait 5 second
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>       
    <script type="text/javascript">
    var counter = 0;
    var timer;
    function countUP() {
        counter = counter + Math.random();
        document.getElementById("hugee").innerHTML =(counter).toFixed(5);
    }
    </script>
</head>
<body onLoad='timer = setInterval("countUP()", 5000);'>
   <div class="col-xs-9 text-right">
     <div class="huge" id="hugee"></div>
   </div>
</body>
    </html>

最新更新