Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Web
Expertise: Beginner
Oct 13, 1999



Application Security Testing: An Integral Part of DevOps

Dynamically Change the Title of an HTML Page

Here is a simple way by which you can dynamically change the title of the browser window (or an HTML page). There are certain scenarios where you can use this feature to provide useful information to the user. For example, if the user is entering a series of data entry survey forms over the Internet, then you may want to change the title of the page as the user proceeds from one page to another.

In the following example, your user can enter a title in the text area which is used to change the title of the browser window. Function UpdateTitle() in the following code uses the "Title" property of document object to change the title of the browser window.

<HEAD><TITLE>Change Title Dynamically:</TITLE></HEAD>
<FORM action="" method=POST name="SampleForm">
<B>Enter Title for the window:</B>
<INPUT TYPE=BUTTON VALUE="Change Title" ONCLICK="javascript:UpdateTitle()">
function UpdateTitle()
	document.title = document.SampleForm.WindowTitle.value;
Deepak Pant
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date