Gets or sets the title of a Document. When the document is the main document that is shown (meaning, not of an iframe), this is usually shown to the user.
var documentTitle = document.title; document.title = newDocumentTitle;
Returns an object of type StringString
The current title of the document.
The following script gets the title of the document, changes the first “r” to a “t” (if there is an “r”) and sets the result as the title of the document.
// Getting the title of the document, replacing the first "r" // with "t" and setting the result as the title of the document. document.title = document.title.replace("r", "t");
Use this property to get or set the title of the document.
When document is the main document that is shown to the user, most browsers show the value of this property to the user as the title of the window or page.