Sometimes, we want to dynamically change a web page’s title with JavaScript.
In this article, we’ll look at how to dynamically change a web page’s title with JavaScript.
How to dynamically change a web page’s title with JavaScript?
To dynamically change a web page’s title with JavaScript, we set its document.title
property.
For instance, we write
document.title = "test";
to set the document.title
property to 'test'
to make the page title ‘test’.
Conclusion
To dynamically change a web page’s title with JavaScript, we set its document.title
property.