1.最简单的时钟显示
<div id="time"></div> <script> setInterval("time.innerHTML=new Date().toLocaleString() + ' 星期' + '日一二三四五六'.charAt(new Date().getDay()); ",1000); </script>