00 Votes

JavaScript: Change Page Title

Question by Guest | 2019-03-08 at 17:28

How can I change the title of an HTML page with JavaScript? Is that possible? I would like to customize the existing title (title in the head of the page) after the page has already been loaded. Do I need a special library for that, maybe jQuery?

ReplyPositiveNegative
1Best Answer1 Vote

You can change the page title of an HTML page with a simple one-liner:

document.title = "New Page Title";

You do not need a library like jQuery. It could not be easier.
2019-03-08 at 23:01

ReplyPositive Negative
Reply

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.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.