HTML DOM Document title attribute
- Previous Page strictErrorChecking
- Next Page URL
- Go Up One Level HTML DOM Documents
Definition and usage
title
Set or return the document's title.
Example
Return the document's title:
document.title;
Change the document's title:
document.title = "A new title";
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 |
- Previous Page strictErrorChecking
- Next Page URL
- Go Up One Level HTML DOM Documents