在网页中动态显示时间

来源:互联网 发布:ubuntu 安装net tools 编辑:程序博客网 时间:2024/05/21 18:34

在标题栏中显示时间:

<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>




阅读全文
0 0
原创粉丝点击