Title textProperty

Title 对象参考手册Title Object

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

Internet Explorer Firefox Opera Google Chrome Safari

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 »


Title 对象参考手册Title Object

Other Extensions