Title text property
Example
Return the text content of the document title tag:
var x = document.getElementsByTagName("TITLE")[0].text;
x The output result is:
HTML DOM Objects
Try it »
Definition and usage
The text property is used to set or return the text content of the document title element.
Browser support

All major browsers support the text property.
Syntax
Return the text attribute:
titleObject
.text
Set the text attribute:
titleObject
.text=
text
Attribute values
| Value | Description |
|---|---|
| text | Describes the text content of the document title element. |
Technical Details
| Return value: | String, returning the text content of the document title element. |
|---|
More examples
Example
Modify the text content of the title element in the document:
document.getElementsByTagName("TITLE")[0].text="New title..";
Try it »
The Title object