复制代码代码如下:
<! 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">
<голова>
<meta http-equiv = "content-type" content = "text /html; charset = utf-8" />
<title> 无标题文档 </title>
<script type = "text/javascript">
// 页面上动态时间
функция time () {
var dt;
var date = new Date ();
dt = date.getfular ()
+ "/"
+ date.getmonth ()
+ "/"
+ date.getDate ()
+ ""
+ (date.gethours () <= 9? '0' + date.gethours (): date
.gethours ())
+ ":"
+ ((date.getminutes () <= 9? '0' + date.getminutes (): date
.getMinutes ()))
+ ":"
+ (date.getSeconds () <= 9? '0' + date.getSeconds (): дата
.getSeconds ());
//document.getElementByid("ht").innerhtml=dt;
вернуть DT;
}
setInterval ("document.getElementById ('ht'). innerhtml = time ()", 1000);
</script>
</head>
<тело>
<span id = "ht"> </span>
</body>
</html>