Take the 2-minute tour ×

Is there any way to display the title of the Webpage in pure text(HTML, Javascript)? I am making a mobile website that involves displaying a lot of text and It would be easier if I just had the website write the title on the toolbar on its own.

share|improve this question
Clarification needed, what tool bar? –  b01 Jul 24 '11 at 5:54

2 Answers 2

up vote 1 down vote accepted

With javascript you can access it via document.title

Example: http://jsfiddle.net/AlienWebguy/ZvmWL/

share|improve this answer
(+1) you learn something new every day. :) –  Matt Ball Jul 24 '11 at 5:53

Not sure if I understand your problem correctly, but you may acces the title Element like any other Element in the Document:

var title = document.getElementsByTagName("title")[0] ;

There also is a shortcut to the title Node's text content (link) in the Document Object:

var text = document.title

The title Element is a required part of any HTML Document so replacing it -- if that is what you wanted to do -- is not legal (link).

share|improve this answer

Your Answer


