在标题栏中显示时间:
<html>
<head>
<title> test </title>
</head>
<script type="text/javascript">
function init(){
var d = new Date();
document.title = d.toLocaleString();
setTimeout("init()",1000);
}
</script>
<body onload = "init()">
</body>
</html>
在状态栏中显示时间:
<html>
<head>
<title> test </title>
</head>
<script type="text/javascript">
function init(){
var d = new Date();
window.status = d.toLocaleString();
setTimeout("init()",1000);
}
</script>
<body onload = "init()">
</body>
</html>