The inputEncoding
property returns the character encoding for the document.
inputEncoding |
Yes | 9 | Yes | Yes | No |
document.inputEncoding
A String, representing the document's character encoding.
The following code shows how to get the character encoding for this document.
<!DOCTYPE html>
<html>
<body>
<p id="demo">test</p>
<!--from w w w .jav a 2 s.c o m-->
<button onclick="myFunction()">test</button>
<script>
function myFunction()
{
var x=document.getElementById("demo");
x.innerHTML=document.inputEncoding;
}
</script>
</body>
</html>
The code above is rendered as follows: