x
 
<!DOCTYPE html>
<html>
<title>我的标题</title>
<body>
<h1>Document 对象</h1>
<h2>title 属性</h2>
<p>本文档的标题是:</p>
<p id="demo"></p>
<script>
document.title = "新标题";
document.getElementById("demo").innerHTML = document.title;
</script>
</body>
</html>