Title textProperty
Examples
Return the text content of the document's title tag:
var x = document.getElementsByTagName("TITLE")[0].text;
xThe output result is:
HTML DOM Objects
Try it Yourself »
Definition and Usage
The text property is used to set or return the text content of the document's title element.
Browser Support
![]()
All major browsers support the text property.
Syntax
Return the text property:
titleObject.text
Set the text property:
titleObject.text=text
Property Values
| Value | Description |
|---|---|
| text | Describes the text content of the document's title element. |
Technical Details
| Return value: | String, returning the text content of the document's title element. |
|---|
More Examples
Example
Modify the text content of the title element in the document:
document.getElementsByTagName("TITLE")
Try it Yourself »
Other Extensions
Title Object