HTML DOM inputEncoding 属性

HTML DOM inputEncoding 属性

Document 对象参考手册 Document 对象

实例

显示当前文档的字符编码:


	document.inputEncoding;

输出结果:


	UTF-8

知识兔 »

定义和用法

inputEncoding 属性可返回文档的编码(在解析时)。

如果问的在内存中创建返回 null

浏览器支持

Opera

除了 Opera浏览器,所有主流浏览器都支持 inputEncoding 属性。

注意: Internet explorer 8 及更早IE 版本不支持该属性。

语法

document.inputEncoding

技术细节

返回值:字符串,返回文档编码
DOM 版本Core Level 3 Document Object

Document 对象参考手册 Document 对象

计算机