How to find the title of the page using javascript

Manideepgoud
Posted by Manideepgoud under JavaScript category on | Points: 40 | Views : 229
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.

Comments or Responses

Login to post response