document.inputEncoding example RUN
 
1
<!DOCTYPE html>
2
<html>
3
    <head>
4
        <meta charset="utf-8">
5
        <style type="text/css">
6
            #result{
7
                color: red;
8
                font-size: 20px;
9
                font-weight: bold;
10
            }
11
        </style>
12
    <body>
13
        <h1>Học lập trình miễn phí tại freetuts.net</h1>    
14
 
15
        <p id="result"></p>
16
        <button onclick="myFunction()">Xem kết quả</button>
17
        <script>
18
            function myFunction(){
19
                var charset = document.inputEncoding;
20
                document.getElementById("result").innerHTML = "characterSet hiện tại là: " + charset;
21
            }
22
        </script>
23
    </body>
24
</html>