To find the title of the page we use
document.title.
<title>DotNetFunda</title>
</head>
<body>
<p id="demo"></p>
<script>
document.getElementById('demo').innerHTML = "The title of the page is:" + document.title;
</script>
In the above code we have given title as DotNetFunda ,
document.title displays what we have written in the title of the page.
OUTPUT
The title of the page is DotNetFunda.