Get the title of the current document:
The result of x will be:
More "Try it Yourself" examples below.
The title property sets or returns the title of the current document (the text inside the HTML title element).
Property | |||||
---|---|---|---|---|---|
title | Yes | Yes | Yes | Yes | Yes |
Return the title property:
Set the title property:
Value | Description |
---|---|
newTitle | Specifies a new title text |
Return Value: | A String, representing the title of the document |
---|---|
DOM Version | Core Level 2 Document Object |
HTML reference: HTML <title> tag
JavaScript reference: HTML DOM Title Object