标题栏显示当前日期与时间的js代码

发布时间:2019-09-05编辑:脚本学堂
分享一例js代码,在网页标题栏目上显示当前日期与时间,很简单有趣的一个js特效,有需要的朋友参考下。

例子,一个不错的js特效,在网页标题栏目上显示当前日期与时间。
 

复制代码 代码示例:
<html>
<head>
<title>网页特效演示,标题栏时间</title>
<!--将以下代码加入HTML的<Head></Head>之间-->
<script language="javascript1.2">
<!--hide
var isnMonth = new
Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
var isnDay = new
Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日");
today = new Date () ;
Year=today.getYear();
Date=today.getDate();
if (document.all)
document.title="欢迎你,今天是: "+Year+"年"+isnMonth[today.getMonth()]+Date+"日"+isnDay[today.getDay()]
//--hide-->
</script>
</head>
<body>
脚本学堂,提醒您,请看标题栏!
</body>
</html>