How to get document default character set

Default character set

document.defaultCharset gets the default character encoding. The return type is string.

Example


<!DOCTYPE HTML> 
<html> 
    <body> 
        <script> 
            document.writeln(document.defaultCharset); 
        </script> 
    </body> 
</html><!-- www .  ja v a  2 s.  c  o  m-->

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