A string containing the document's title. If the title was overridden by setting document.title
, it contains that value. Otherwise, it contains the title specified in the <title>
element.
document.title = newTitle;
newTitle
is the new title of the document. The assignment affects the return value of document.title
, the title displayed for the document (e.g., in the titlebar of the window or tab), and it also affects the DOM of the document (e.g., the content of the <title>
element in an HTML document).
Assume the document's <head>
looks like:
<head>
<meta charset="UTF-8" />
<title>Hello World!</title>
</head>
console.log(document.title); // "Hello World!"
document.title = "Goodbye World!"; // Page title changed
console.log(document.title); // "Goodbye World!"
Specifications Browser compatibility
Loadingâ¦
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.5