How to set the language of text in the linked document in HTML5 ?
The approach of this article is to specify the language of the text in the linked document in HTML5 by using a hreflang attribute in the HTML Tag.The value (or languageCode) passed here is code of the linked document. (for e.g. if the document/website in the given link is in English en is passed as the value).
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.
Example 1: Below code illustrates the use of hreflang attribute in link element.
Output: Above link document written in English Language.
Output: Above link document written in Spanish Language.