HTML DOM inputEncodingProperty
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
![]()
![]()
![]()
![]()
![]()
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 |
Other Extensions
Document Object