复制代码代码如下 :
<! 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">
// 页面上动态时间
함수 시간 () {
var dt;
var date = 새 날짜 ();
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 ()", 1000);
</스크립트>
</head>
<body>
<span id = "ht"> </span>
</body>
</html>