Lang Attribute
lang=language code
Explanation
Lang attribute is used to mention the "Language"
of the text used in an element.
Values added with this attribute are:
Value | Description |
lang | language code for the content. |
Value for this attribute must possess a language code or it should be applied as an empty string.
Example Code:
Result :
- The word "Good Morning" is converted into Spanish. The language code for Spanish is "es".
- It is used as a reference for the person who developed the site.
It is supported by the entire elements in HTML5 & it exists in the previous versions of the HTML.
Limitations:
It is applicable to all major browsers.