作者在 2008-07-16 10:51:56 发布以下内容
<body>'必须在BODY或TABLE等HTML标签中才能正常使用显示 innerHTML语句
<DIV id=dd style="background-color:red" align=left></DIV>
<DIV id=dd style="background-color:red" align=left></DIV>
<!-- 动态时间BEGIN -->
<SCRIPT>
<SCRIPT>
function time()
{
var mydate=new Date()
var year=mydate.getYear()
var month=mydate.getMonth()+1
var date=mydate.getDate()
var day=mydate.getDay()
var hours=mydate.getHours()
var minute=mydate.getMinutes()
var second=mydate.getSeconds()
var arr=new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六")
var str=year+"年"+month+"月"+date+"日"+arr[day]+" "+((hours<10)? "0":"")+hours+((minute<10)? ":0":":")+minute+((second<10)? ":0":":")+second
dd.innerHTML=str
setTimeout("time()",1000)
}
{
var mydate=new Date()
var year=mydate.getYear()
var month=mydate.getMonth()+1
var date=mydate.getDate()
var day=mydate.getDay()
var hours=mydate.getHours()
var minute=mydate.getMinutes()
var second=mydate.getSeconds()
var arr=new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六")
var str=year+"年"+month+"月"+date+"日"+arr[day]+" "+((hours<10)? "0":"")+hours+((minute<10)? ":0":":")+minute+((second<10)? ":0":":")+second
dd.innerHTML=str
setTimeout("time()",1000)
}
time()
</SCRIPT>
<!-- 动态时间END -->
</font>
</SCRIPT>
<!-- 动态时间END -->
</font>