HTML DOM Document title attribute

Definition and usage

title Set or return the document's title.

Example

Return the document's title:

document.title;

Try it yourself

Change the document's title:

document.title = "A new title";

Try it yourself

Syntax

Return title attribute:

document.title

Set title attribute:

document.title = newTitle

Attribute value

Value Description
newTitle New document title.

Return value

Type Description
String Document title.

Browser support

document.title It is a DOM Level 2 (2001) feature.

All browsers support it:

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
Support 9-11 Support Support Support Support

Related Pages

HTML <title> Tag

HTML DOM Title Object