js动态时钟

<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <title></title>
 </head>
 <body>
  <div id="show">
  </div>
  <script type="text/javascript">
   
   setInterval(function(){
    var date = new Date();
    document.getElementById("show").innerText = date.toLocaleString();
   },1000);
   
  </script>
  
 </body>
</html>

你可能感兴趣的:(js)