HTML DOM Document characterSet
Example
Get the character encoding for a document:
encoding = document.characterSet;
Try it Yourself »
Definition and Usage
The characterSet
property returns the character encoding for a document.
See Also:
Deprecated Aliases:
Syntax
document.characterSet
Return Value
Type | Description |
String | The document's character encoding. |
Browser Support
document.characterSet
is a DOM Level 3 (2004) feature.
It is fully supported in all browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | 9-11 | Yes | Yes | Yes | Yes |