0 0 Votes

jQuery: Change the Title of an HTML Page

Question by Compi | 07/03/2019 at 20:43

How can I change the page title of an HTML page with the help of jQuery, even after loading the page? Is that possible?

ReplyPositiveNegative

Stefan Trost

Show Profile | Message
Avatar
1Best Answer
1 Vote

You can change the title of the page with the help of jQuery as follows:

$(document).prop('title', 'New Title');

However, it is more elegant if you work directly with pure native JavaScript instead, then you do not need jQuery at all:

document.title = "New Title";

This is more efficient because jQuery does nothing else in the background than just to set the value of document.title.
08/03/2019 at 15:25

ReplyPositive Negative
Reply

Related Topics

jQuery: Change Image
Question | 1 Answer

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 articles on askingbox.com. How to do.