字符编码

2017-06-19 12:12:00
admin
原创
457
<!DOCTYPE html>
<html>
<head>
    <title>Keypress Event Example</title>
    <script type="text/javascript" src="http://code.ybao.org/demo/js/EventUtil.js"></script>
</head>
<body>
    <input type="text" id="myText" />
    <script type="text/javascript">
        var textbox = document.getElementById("myText");
        EventUtil.addHandler(textbox, "keypress", function(event){
            event = EventUtil.getEvent(event);
            alert(EventUtil.getCharCode(event));     
        });
    </script>
</body>
</html>
  • QQ讨论群
  • 关注微信
    • 欢迎咨询
    • 欢迎加入QQ群 16506021
  • 公众号:源宝网络