How to get document character set

document.characterSet

document.characterSet returns document character set encoding. This is a read-only property. The return type is string.

Example


<!DOCTYPE HTML> 
<html> 
    <body> 
        <script> 
            document.writeln(document.characterSet); 
        </script> 
    </body> 
</html><!--  www.  ja  va 2 s .  c om-->

Click to view the demo





















Home »
  Javascript »
    Javascript Reference »




Array
Canvas Context
CSSStyleDeclaration
CSSStyleSheet
Date
Document
Event
Global
History
HTMLElement
Input Element
Location
Math
Number
String
Window