Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (20.3k points)

I have a webpage that implements a set of tabs each showing different content. The tab clicks do not refresh the page but hide/unhide contents at the client-side.

Now there is a requirement to change the page title according to the tab selected on the page ( for SEO reasons ). Is this possible? Can someone suggest a solution to dynamically alter the page title via javascript without reloading the page?

1 Answer

0 votes
by (40.7k points)

You can try using the document.title = "This is the new page title.";, 

This will defeat the purpose of SEO. If you want this to be compatible with most of the important crawlers, then you need going to need to change the title tag itself, which will involve reloading the page (PHP, or the like). But, if you want to change the page title in a way that a crawler can see.

Related questions

0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer

Browse Categories

...