0 0 Votes

JavaScript: Change Page Title in Browser dynamically

Tip by Anja Proggy | 08/11/2013 at 03:06

If you want to change the title of a website dynamically using JavaScript, you can just use this simple line:

<script type="text/javascript">
  document.title = 'My New Title';

You only have to set a string to "document.title" and the title shown in the browser is changing.

Please note: it is not a good idea to use this function for search engine optimization (SEO) reasons, because most search engines are ignoring JavaScript, so that this script does not have any effect. But of course, you can use the script to give users a better orientation when dynamically changing the content of the web page.


About the Author

Avatar AuthorThe author has not added a short description to his profile yet.
Show Profile | Message


Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.


Ask your own question or write your own articles on askingbox.com. How to do.