1 <div id="timer"></div> 2 <script type="text/javascript"> 3 window.setInterval(function(){ 4 var _date = new Date(); document.getElementById('timer').innerHTML = _date.toLocaleString() + ' 星期' + '日一二三四五六'.charAt(_date.getDay()); 5 }, 1000); 6 </script>
转载于:https://www.cnblogs.com/intval/p/3574190.html