HTML global attribute lang








The lang attribute sets the language of an element's contents.

The value for the lang attribute must be a valid ISO language code.

The lang attribute is intended to allow the browser to adjust its approach to displaying an element.

Syntax

<element lang="language_code">

Attribute Values

language_code
set the language code for the element's content.

Browser compatibility

lang Yes Yes Yes Yes Yes




Example

<!DOCTYPE HTML>
<html>
<body>
    <p lang="en">Hello</p>
    <p lang="fr">Bonjour</p>
</body>
</html>

Click to view the demo