复制代码代码如下:
<! doctype html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "content-type" content = "text /html; charset = utf-8" />
<title> 无标题文档 </title>
<script type = "text/javascript">
// 页面上动态时间
เวลาฟังก์ชัน () {
var dt;
วันที่ var = วันที่ใหม่ ();
dt = date.getlyear ()
-
+ date.getMonth ()
-
+ date.getDate ()
-
+ (date.getHours () <= 9? '0' + date.getHours (): วันที่
.getHours ())
-
+ ((date.getMinutes () <= 9? '0' + date.getMinutes (): วันที่
.getMinutes ()))
-
+ (date.getSeconds () <= 9? '0' + date.getSeconds (): วันที่
.getSeconds ());
//document.getElementByid("ht").innerhtml=dt;
กลับ dt;
-
setInterval ("document.getElementById ('ht'). innerhtml = time ()", 1,000);
</script>
</head>
<body>
<span id = "ht"> </span>
</body>
</html>