<!DOCTYPE html>
<html>
<body>

<p>Click the button to check the encoding of this document</p>

<button onclick="myFunction()">Try it</button>

<p><strong>Note:</strong> Internet explorer 8 and earlier does not support the inputEncoding property.</p>

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.inputEncoding;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>