Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM lang property

HTML DOM lang property

Element Object Reference Element object


Definition and Usage

The lang property sets or returns the language of an element.

Syntax

HTMLElementObject.lang=

language-code


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the lang property


Example

Example

Return the language of the element:

Output result:

Body language: en-us

An alternate way: en-us

Try it »


Element Object Reference Element object