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