返回到:DOM 对象:HTML DOM Document 对象
inputEncoding 属性可返回文档的编码(在解析时)。
如果问的在内存中创建返回 null 。
浏览器支持:
除了 Opera浏览器,所有主流浏览器都支持 inputEncoding 属性。
注意: Internet explorer 8 及更早IE 版本不支持该属性。
document.inputEncoding
返回值: | 字符串,返回文档编码 |
---|---|
DOM 版本 | Core Level 3 Document Object |
显示当前文档的字符编码:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Web176教程网(web176.com)</title> </head> <body> <p id="demo">单击按钮确认文档的编码方式</p> <button >