Titeltekst eigenschap

Definitie en gebruik

text Eigenschappen instellen of teruggeven van de tekst van de documenttitel.

Zie ook:

HTML Referentiemanual:HTML <title> tag

Voorbeeld

Voorbeeld 1

Geef de tekst van de documenttitel terug:

var x = document.getElementsByTagName("TITLE")[0].text;

Try it yourself

Voorbeeld 2

Wijzig de tekst van de documenttitel:

document.getElementsByTagName("TITLE")[0].text = "A new title text..";

Try it yourself

Syntax

Return text attribute:

titleObject.text

Set text attribute:

titleObject.text = text

Attribute value

Value Description
text Specifies the text of the document title.

Technical details

Return value: A string value representing the text of the document title.

Browser support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support