DOM Properties
Document.title
Reads or updates the document title shown in browser UI. It does not modify an h1 or guarantee a particular search result title. Example result: ByteMind.
Formal Syntax & Structure
html syntaxhtml
document.titleReturn Value
string
Current document value.
Working Example
Example Snippethtml
<p> Result: <output id="result"></output></p><script> const result = document.getElementById("result"); (async () => { document.title = "ByteMind"; result.textContent = document.title; })().catch(error => { result.textContent = "Error: " + error.name; });</script>