複製代碼代碼如下:
<!Doctype HTML公共“ - // W3C // DTD XHTML 1.0 Transitional // en”“” http://www.org/tr/tr/xhtml1/dtd/xhtml1-xhtml1-transitional.transitional.dtdd'>
<html xmlns =“ http://www.w3.org/1999/xhtml”>
<頭>
<meta http-equiv =“ content-type” content =“ text /html; charset = utf-8” />
<title>無標題文檔</title>
<腳本類型=“ text/javascript”>
//頁面上動態時間
功能時間(){
var dt;
var date = new Date();
dt = date.getlucear()
+“/”
+ date.getMonth()
+“/”
+ date.getDate()
+“”
+(date.gethours()<= 9?'0' + date.gethours():日期
.gethours())
+“:”
+((date.getminutes()<= 9?'0' + date.getMinutes():date
.getMinutes())
+“:”
+(date.getSeconds()<= 9?'0' + date.getSeconds():date
.getSeconds());
//document.getElementById(“ht").innerhtml = dt;
返回DT;
}
setInterval(“ document.getElementById('ht')。innerhtml = time()”,1000);
</script>
</head>
<身體>
<span ID =“ ht”> </span>
</body>
</html>