TOC PREV NEXT INDEX

domref



title


Gets/sets the title of the current document.

Syntax

document.title = t
 
t = document.title
 

Parameters

t is a string containing the document title.

Example

This example checks to see if the document has a title that can be set and, if so, changes it to the value of the input parameter:

function setTitle(str){
 
  if(document.title){
 
    document.title=str;
 
}
 

You can call a function like this in the HTML with the following elements:

<input type="text"
 
   name="t" 
 
   value="HTMLTitleElement" 
 
   size=30>
 
<input type="button" 
 
   value="set the HTMLDocument:title" 
 
   onClick="setTitle(form.t.value);">
 

Where the button takes the value in the text element "t" and passes it to the function.

Notes

None.

Specification

DOM Level 0. Not part of specification.


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX