JS实现网页切出网站TITLE变化

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>这里是网站标题</title>
</head>
<body>
<script type="text/javascript">
document.body.onfocus = function(){
document.title = '这里是网站标题';
};
document.body.onblur = function(){
document.title = 'i miss you';
};
</script>

</body>
</html>