X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Title text Property

Title Object Reference Title Object

Example

Return the text of the document's title:

var x = document.getElementsByTagName("TITLE")[0].text;

The result of x will be:

HTML DOM Objects

Try it yourself »


Definition and Usage

The text property sets or returns the text of the document's title.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The text property is supported in all major browsers.


Syntax

Return the text property:

titleObject.text

Set the text property:

titleObject.text=text

Property Values

Value Description
text Specifies the text of the document's title

Technical Details

Return Value: A String, representing the text of the document's title


More Examples

Example

Change the text of the document's title:

document.getElementsByTagName("TITLE")[0].text = "A new title text..";

Try it yourself »


Title Object Reference Title Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook