复制代码代码如下:
<! doctype html public "-// w3c // dtd xhtml 1.0 transitional // en"
<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 date = new date () ؛
dt = date.getlyear ()
+ "/"
+ date.getmonth ()
+ "/"
+ date.getDate ()
+ ""
+ (date.gethours () <= 9؟ '0' + date.gethours (): التاريخ
.
+ ":"
+ ((date.getMinutes () <= 9؟ '0' + date.getMinutes (): التاريخ
.
+ ":"
+ (date.getSeconds () <= 9؟ '0' + date.getSeconds (): التاريخ
.getSeconds ()) ؛
//document.getElementById("ht").innerhtml=dt ؛
إرجاع DT ؛
}
setInterval ("document.getElementById ('ht'). innerhtml = time ()" ، 1000) ؛
</script>
</head>
<body>
<span id = "ht"> </span>
</body>
</html>