Which attribute is used to declare the language of the web page in HTML ?
The HTML lang attribute is used to declare the language of the element content it is used on. Some examples of languages are en for English, es for Spanish, etc. This attribute contains a single value, which is the language_code that is used to specify the language of the content that is displayed.
The below examples illustrate the lang attribute declaration:
Example 1: In this example we will use ‘en’ for the English language.
Example 2: In this example we will use ‘fr’ for the French language.