web api instance property
Document: characterSet property
The Document.characterSet
read-only property returns the character encoding of the
document that it’s currently rendered with.
[!NOTE] A “character set” and a “character encoding” are related, but different. Despite the name of this property, it returns the encoding.
Value
A string.
Examples
console.log(document.characterSet);
// document's character encoding, such as "ISO-8859-1" or "UTF-8"
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.