Lang Attribute

lang=language code


Lang attribute is used to mention the "Language" of the text used in an element.
<ele lang="lang code">
Values added with this attribute are:
langlanguage 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 :

Good Morning

Buenos dias

  • 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.


It is applicable to all major browsers.

Ask Questions

Ask Question