Languages
[Edit]
EN

JavaScript - dynamically change web page title

3 points
Created by:
Krzysiek
741

In this article, we would like to show you how to dynamically change web page title using JavaScript​​​​​.

Quick solution:

document.title = 'Example title';

 

Practical example

In this example, we use document.title property to change the web page's title dynamically.

<!doctype html>
<html>
<body>
  <script>

    document.title = 'Example title';

  </script>
</body>
</html>

Result:

JavaScript - dynamically change web page title
JavaScript - dynamically change web page title

See also

  1. HTML - set web page title

References

  1. Document.title - Web APIs | MDN

Alternative titles

  1. JavaScript - set web page title
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join