复制代码代码如下:
<! Doctype html public "-// w3c // dtd xhtml 1.0 transisi // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "konten tipe" content = "text /html; charset = utf-8" />
<title> 无标题文档 </iteme>
<type skrip = "Teks/JavaScript">
// 页面上动态时间
waktu fungsi () {
var dt;
var date = new date ();
dt = date.getlyear ()
+ "/"
+ date.getmonth ()
+ "/"
+ date.getDate ()
+ ""
+ (date.getHours () <= 9? '0' + date.getHours (): Tanggal
.getHours ())
+ ":"
+ ((date.getMinutes () <= 9? '0' + date.getMinutes (): Tanggal
.getMinutes ()))
+ ":"
+ (date.getSeconds () <= 9? '0' + date.getSeconds (): Tanggal
.getSeconds ());
//document.getElementById("ht").innerhtml=dt;
mengembalikan dt;
}
setInterval ("document.getElementById ('ht'). innerHtml = time ()", 1000);
</script>
</head>
<body>
<span id = "ht"> </span>
</body>
</html>