<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html> <head> <title>时钟</title> <script type="text/javascript"> var fn = function(){ var d = new Date(); document.body.innerHTML = d.toLocaleString(); } window.setInterval(fn,1000); </script> </head> <body> </body> </html>
一个时钟代码~~~以后说不定项目能用到