Document: characterSet property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{ ApiRef("DOM") }}

The **Document.characterSet** read-only property returns the character encoding of the document that it's currently rendered with.

توجه: 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

js
console.log(document.characterSet);
// document's character encoding, such as "ISO-8859-1" or "UTF-8"

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}