</head> <body> <form id="form1" action="" method="post"> <input id="sj" type="text" value="" /> </form> <script language="javascript" type="text/javascript"> function shijian(){ var D=new Date(); var yy=D.getFullYear(); var mm=D.getMonth()+1; var dd=D.getDate(); var h=D.getHours(); var m=D.getMinutes(); var s=D.getSeconds(); var time=yy+"-"+mm+"-"+dd+" "+h+":"+m+":"+s; document.getElementById("sj").value=time; setTimeout("shijian()",1000); } shijian(); </script> </body> </html>