HTML DOM Element lang attribute
- Previous Page isSupported()
- Next Page lastChild
- Go to Parent Layer HTML DOM Elements Object
Definition and usage
lang
The attribute sets or returns the value of the element's lang attribute.
lang
The lang attribute specifies the language code of the element, for example "en" represents English, "es" represents Spanish, or "fr" represents French.
Syntax
Return the lang attribute:
element.lang
Set the lang attribute:
element.lang = lang_code
Attribute value
Value | Description |
---|---|
lang_code |
the value of the element's lang attribute. Please refer to our complete language code reference. |
Return value
Type | Description |
---|---|
String | the value of the element's lang attribute. |
Browser support
All browsers support element.lang
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous Page isSupported()
- Next Page lastChild
- Go to Parent Layer HTML DOM Elements Object