document.characterSet

In this chapter you will learn:

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

<!DOCTYPE HTML> <!-- j  av a  2s .  co  m-->
<html> 
    <body> 
        <script> 
            document.writeln(document.characterSet); 
        </script> 
    </body> 
</html>

Click to view the demo

Next chapter...

What you will learn in the next chapter:

  1. How to get and set document character encoding 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