The title property

The title property holds the value (string) of the title of the HTML document.
The title is set within the title tags in the head section of the document.

<head>
<title>Honda Bikes</title>
</head>
<body>

<script>
document.write("<h1>" + document.title + "</h1>");
</script>

<p>Honda bikes are among the best in the world.</p>

</body>

This is useful when you want to display the title of the document in another place than in the top bar of the window.

Leave a Reply