<html>
<title>My title</title>
<body>
<h1>The Document Object</h1>
<h2>The title Property</h2>
<p>The title of this document is:</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = document.title;
</script>
</body>
</html>