动态显示时间

<html>
  <head>
    <title>动态显示时间</title>
    <style type = "text/css">

    </style>
  </head>
  <body>
    <div id='times'>
    </div>
      <script type='text/javascript'>
        function getD1()
       {
	  var date =new Date();
	  var d1 =date.toLocaleString();
	  var div1=document.getElementById("times");
	  div1.innerHTML = d1;
      }
      setInterval("getD1();",1000);
    </script>
  </body>
</html>
posted @ 2021-06-07 21:58  -筱  阅读(40)  评论(0编辑  收藏  举报