Favorites

DOM Document.title Property

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Document.title
DOM Document PropertyThis property is supported by all modern browsers.
Updated 28th November 2026

The title property gets or sets the page title shown in the browser tab.

Description

The title property gets or sets the document's title, shown in the browser tab, history and bookmarks. Single-page applications should update it whenever the view changes, so the tab and screen readers reflect the current page. Some sites also add an unread count, like "(3) Inbox".

The value is the text content of the first <title> element, with white space collapsed. If the page has no <title>, setting document.title creates one in the head.

Search engines generally use the title from the initial HTML, so set meaningful titles on the server where you can. For notifications, changing the title briefly, such as "(1) New message", draws attention to a background tab without being intrusive.

Syntax

document.title
document.title = text

Value

A string: the text of the document's <title>.

Example

console.log(JSON.stringify(document.title));
document.title = '(2) Messages';
console.log(document.title);

Browser Support

The following information will show you the current browser support for the Document.title property. Hover over a browser icon to see the version that first introduced support for this property.

This property is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee