How to get and set document character encoding in Javascript

Get and set char set

document.charset gets or sets the document character set encoding.

Example


<!DOCTYPE HTML> 
<html> 
    <body> 
        <script> 
            document.writeln(document.charset); 
        </script> 
    </body> 
</html><!--   w  ww . java2  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