English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
characterSetA read-only property that returns the character encoding of the document.
Character encoding is a set of characters and how bytes are interpreted as these characters.
The properties document.charset and document.inputEncoding are old aliases of document.characterSet. They are no longer used.
document.characterSet
<button onclick="alert(document.characterSet);">Show Character Encoding</button>Test See‹/›
The numbers in the table specify the first browser version that fully supports the characterSet property:
Property | |||||
characterSet | 45 | 44 | 34 | 9 | 12 |
Return Value: | A string representing the document character encoding |
---|---|
DOM Version: | DOM Level3 |