html显示时间
1 <html> 2 <head> 3 <script type="text/javascript"> 4 function time() { 5 var time = new Date(); 6 document.getElementById("time").innerHTML = time.toLocaleTimeString(); 7 setTimeout("time()", 1000); 8 } 9 window.onload = time; 10 </script> 11 12 </head> 13 <body > 14 <span id="time"></span> 15 </body> 16 </html>