Questions tagged [hreflang]

The hreflang attribute specifies the language of an HTML document.

Many websites serve users from around the world with content translated or targeted to users in a certain region. Google uses the rel="alternate" hreflang="x" attributes to serve the correct language or regional URL in Search results.

80 questions
-1
votes
2 answers

How to get page language (hreflang) in JavaScript and add it as a parameter to a link

As an example, I have this code that is able to add the title of a page as a parameter to a link that is identified as an ID. I would like to be able to do the same for the language of the page. Thanks for your help!