spacer
Yehuda Shiran July 28, 2000
Manipulating the Document's Title
Tips: July 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Google Chrome Playing Catch-Up on Extensions
Open Solutions Alliance Gets New Leadership
Red Hat Spacewalk Expands Linux Management
Both Internet Explorer and Netscape Navigator display the document's title in the title bar, together with the browser name (Microsoft Internet Explorer or Netscape). You can set the document's title by the <TITLE></TITLE> pair in the HEAD portion. The browsers behave differently if you don't specify the title as above or the string between <TITLE> and </TITLE> is empty or includes only blank characters. Internet Explorer uses the the document's full URL as its title, and displays it on the title bar. Netscape Navigator does not display any title in this case, except the browser name, Netscape.

When the Web page includes frames, the title bar displays the title of the document which contains the frameset. Documents providing the content of the frames may include their own titles in between <TITLE> and </TITLE>, but they don't affect the title bar.

You can manipulate the document's title via the document.title property. You can both set and use it in many different ways. A simple assignment may look like this:

document.title = "This is tip number 28 in July 2000";

You can now the write the document's title to the body of the document:

document.write("<CENTER><H1>" + document.title + "</H1></CENTER>");

The following line is the result of the above two JavaScript statements:


People who read this tip also read these tips:

Look for similar tips by subject:

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags