HTML DOM inputEncodingProperty

Document 对象参考手册Document Object

Examples

Display the character encoding of the current document:

document.inputEncoding;

Output result:

UTF-8

Try it Yourself »

Definition and Usage

The inputEncoding property returns the encoding of the document (at the time of parsing).

If the document was created in memory, returnsnull 。


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Except Opera browser, all major browsers support the inputEncoding property.

Note:Internet Explorer 8 and earlier IE versions do not support this property.


Syntax

document.inputEncoding

Technical Details

Return value: String, returns the document encoding
DOM Version Core Level 3 Document Object


Document 对象参考手册Document Object

Other Extensions