document.charset

In this chapter you will learn:

  1. 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.

<!DOCTYPE HTML> <!--from   j a  va 2 s  . c  om-->
<html> 
    <body> 
        <script> 
            document.writeln(document.charset); 
        </script> 
    </body> 
</html>

Click to view the demo

Next chapter...

What you will learn in the next chapter:

  1. How to get the document compatibility mode in Javascript
Home » Javascript Tutorial » Document
Document Object
document.body
document.characterSet
document.charset
document.compatMode
document.cookie
document.defaultCharset
document.defaultView
getElementsByTagName(tagName)
document.getElementsByClassName
document.getElementsByName
document.images
document.lastModified
document.location
document.implementation
document.querySelectorAll
document.readyState
document.title
document.URL
document.writeln