Document.title (Property)

The title text for the document.


DOM level - 1
JavaScript - 1.0
JScript - 1.0
Internet Explorer - 3.02
Netscape - 2.0
Opera - 3.0
Property/method value type:String primitive
JavaScript syntax:IEmyDocument.all.tags("TITLE")[0].text
HTML syntax:<HEAD><TITLE>aTitleText</TITLE><HEAD>
Argument list:aTitleTextSome text in the title heading block

The document title is yielded by this property. The property is not enumerable in the Netscape browser but it is in MSIE. In Netscape this property value is read-only but in MSIE you can modify it whenever you want by assigning a new value to one of the property references that point at the string containing the title text.

This is the text placed inside the <TITLE> tags. It exists inside the<HEAD> portion of the document, which suggests the document is really rooted at the <HTML> tag rather than the <BODY> tag. There are minor hierarchical inconsistencies like this.

In the MSIE browser, a special TITLE object is also created to help construct a DOM hierarchy inside the browser. The text attribute of that object references the same value as this property.


See also:<TITLE>, Document object, Document.lastModified, Element.title, HTML object, HTML.title, LINK.title, TITLE object, TITLE.text