Javascript Reference - HTML DOM inputEncoding Property








The inputEncoding property returns the character encoding for the document.

Browser Support

inputEncoding Yes 9 Yes Yes No

Syntax

document.inputEncoding

Return Value

A String, representing the document's character encoding.

Example

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: