devxlogo

Dynamically Change the Title of an HTML Page

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.

 Change Title Dynamically:
Enter Title for the window: