Document.title

  • Revision slug: DOM/document.title
  • Revision title: document.title
  • Revision id: 114195
  • Created:
  • Creator: JesseW
  • Is current revision? No
  • Comment

Revision Content

Summary

document.title returns the title of the document.

Syntax

sTitle = document.title 

Parameters

  • sTitle is a string that contains the title of the current document.

Example

<html>
  <title>Hello World!</title> 
  <body>
... 
// document.title returns "Hello World!"

Specification

title

Revision Source

<p>
</p>
<h3 name="Summary">Summary</h3>
<p><b>document.title</b> returns the title of the document. 
</p>
<h3 name="Syntax">Syntax </h3>
<pre class="eval"><i>sTitle</i> = document.title 
</pre>
<h3 name="Parameters">Parameters </h3>
<ul><li><code>sTitle</code> is a string that contains the title of the current document.
</li></ul>
<h3 name="Example">Example </h3>
<pre>&lt;html&gt;
  &lt;title&gt;Hello World!&lt;/title&gt; 
  &lt;body&gt;
... 
// document.title returns "Hello World!"
</pre>
<h3 name="Specification">Specification </h3>
<p><a class="external" href="http://www.w3.org/TR/2000/WD-DOM-Level-2-HTML-20001113/html.html#ID-18446827">title </a>
</p>
Revert to this revision