<!DOCTYPE html>
 <html lang="en">
 <head>
     <meta charset="UTF-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>Document</title>
     <style>
     div{
         width: 230px;
         height: 45px;
         line-height: 40px;
         color:#fff;
         background-color: skyblue;
         text-align: center;
  
     }
     </style>
 </head>
 <body>
  
     <button>显示当前系统时间</button>
     
     <div>某个时间</div>
     
     <script>
  
         var btn=document.querySelector('button');
         var div=document.querySelector('div');
             
             btn.οnclick=function(){
             div.innerHTML=getDate();
         }
  
         function getDate(){
             var date=new Date();
             var year=date.getFullYear();
             var month=date.getMonth();
             var dates=date.getDate();
             var arr=['星期日','星期一','星期二','星期三','星期四','星期五','星期六',];
             var day=date.getDay();
             return'今天是'+year+'年'+month+'月'+dates+'日'+arr[day];
         }
  
     </script>
     
  
 </body>
 </html>
7320计算机02盛少将










