<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body onload="sj()"> <div id="ge1" style="width: 300px;height: 20px;background:indianred; text-align: center;"></div><!--表格边框--> <div id="ge" style="width: 300px;height: 20px;background:indianred; text-align: center;"></div> <script type="text/javascript"> function sj(){ var biao=new Date(); var i=new Array(7); i[0]="星期一"; i[1]="星期二"; i[2]="星期三"; i[3]="星期四"; i[4]="星期五"; i[5]="星期六"; i[6]="星期七"; document.getElementById("ge").innerHTML=biao.getFullYear()+"/"+biao.getMonth()+1+"/"+biao.getDate()+"/"+i[biao.getDay()-1]; document.getElementById("ge1").innerHTML=biao.getHours()+":"+biao.getMinutes()+":"+biao.getSeconds(); x=setTimeout('sj()',500) } </script> </body> </html>