Display the character encoding for this document:
var x = document.inputEncoding;
Click the button to check the encoding of this document.
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from www. j a v a 2s. c om*/ var x = document.inputEncoding; document.getElementById("demo").innerHTML = x; } </script> </body> </html>
The inputEncoding property returns the character encoding for the document.
The inputEncoding property returns a String representing the document's character encoding.
This property is an alias of document.characterSet.