使用document的title属性,可以改变标题栏上显示字符串
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
var index=1
var indexNum=6
var indexs= new Array(indexNum)
indexs[1]="看标题哦,亲1"
indexs[2]="看标题哦,亲2"
indexs[3]="看标题哦,亲3"
indexs[4]="看标题哦,亲4"
indexs[5]="看标题哦,亲5"
indexs[6]="看标题哦,亲6"
function changmessage(){
document.title=indexs[index++]
if(index>indexNum)
{
index=1;
}
setTimeout('changmessage()',2000);
}
</script>
</head>
<body οnlοad="changmessage()">
</body>
</html>
转载于:https://blog.51cto.com/1085616858/851578