HTML DOM Document title attribute
- Föregående sida strictErrorChecking
- Nästa sida URL
- Åter till föregående nivå 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 web browsers support it:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Stöd | 9-11 | Stöd | Stöd | Stöd | Stöd |
- Föregående sida strictErrorChecking
- Nästa sida URL
- Åter till föregående nivå HTML DOM Documents