时间自己变动代码

<body onload='f2()'> //需要在body里触发

 

//以下代码找个空位随便放
<div align="center">
 <span class="STYLE7" id='time'></span>
</div>
<script>
      function f2(){
          var d1 = new Date();
          var time = document.getElementById('time');
          time.innerHTML = d1.toLocaleString();
          window.setInterval('f1()',1000);
         
      }
      function f1(){
          var time = document.getElementById('time');
          var d1 = new Date();
          time.innerHTML = d1.toLocaleString();
      }
</script>

 

posted on 2012-03-30 10:46  Roc ps'king  阅读(223)  评论(0编辑  收藏  举报

导航