1 <script> 2 // 正常时间显示 3 function startTimer(){ 4 var today=new Date(); 5 var h=today.getHours(); 6 var m=today.getMinutes(); 7 var s=today.getSeconds(); 8 m=m<10?"0"+m:m; 9 s=s<10?'0'+s:s; 10 $('#time').html(h+":"+m+":"+s); 11 t=setTimeout(function(){startTimer()},500); 12 } 13 </script>