目录

HTML DOM Document title

Example

Return the title of the document:

document.title;
Try it Yourself »

Change the title of the document:

document.title = "A new title";
Try it Yourself »

Description

The title property sets or returns the title of the document.


Syntax

Return the title property:

document.title

Set the title property:

document.title = newTitle

Properties

Value Description
newTitle The new document title.

Return Value

Type Description
String The document title.

Browser Support

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

It is fully supported in all browsers:

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