Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM inputEncoding property

HTML DOM inputEncoding property

Document Object Reference Document Object

Example

Show the character encoding of the current document:

document.inputEncoding;

Output result:

UTF-8

Try it »


Definition and Usage

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

If it was created in memory, it returns null .


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers except Opera 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 returning the document encoding
DOM version Core Level 3 Document Object

Document Object Reference Document Object