HTML: Language attribute
What is language attribute
Language Attribute allows you to specify a human language, such as English, Chinese, Russian.
Language Attribute is a global attribute, meaning that you can add it to any tag.
<span lang="zh">中文</span>
valid values for Language Attribute are HTML: language tags (BCP 47) .
Why use language attribute
- Useful when you have multiple languages in a page.
- To distinguish Chinese and Japanese.
- To distinguish regional variations. E.g. Chinese in China vs Taiwan.