2013-01-16 6 views

답변

2
<script type="text/javascript"> 
    function myKeyPress(e){ 

     var keynum; 

     if(window.event){ // IE     
      keynum = e.keyCode; 
     }else 
      if(e.which){ // Netscape/Firefox/Opera     
       keynum = e.which; 
      } 
     alert(String.fromCharCode(keynum)); 
    } 
    </script> 


<form> 
    <input type="text" onkeypress="return myKeyPress(event)" /> 
</form> 

에 감사 당신의 대답이 질문을 참조 How to find out what character key is pressed?

+0

고맙습니다. 나와 함께 잘 작동합니다. :) – user1854912