Javascript examples for DOM:Document inputEncoding
The inputEncoding property returns the character encoding for the document.
This property is an alias of document.characterSet.
A String, representing the document's character encoding
The following code shows how to Display the character encoding for this document:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">check the encoding of this document</button> <p id="demo"></p> <script> function myFunction() {// w w w. j av a2 s. co m var x = document.inputEncoding; document.getElementById("demo").innerHTML = x; } </script> </body> </html>