HTML DOM Document charset attribute

Definition and Usage

Not recommended charset attribute. Do not use it.

charset The attribute may not work in future browsers.

Alternative:

Document characterSet attribute

See also:

HTML Character Set Reference Manual

Example

Get the character encoding of the document:

encoding = document.charset;

Try It Yourself

Syntax

document.charset

Return Value

Type Description
String The character encoding of the document.