Javascript examples for DOM:Document characterSet
The characterSet property returns the character encoding for the document.
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 ww . j a v a 2 s. c om*/ var x = document.characterSet; document.getElementById("demo").innerHTML = x; } </script> </body> </html>