<script> function press(e){ alert(e.charCode + " " + e.keyCode); } </script> <input type="text" onkeypress="press(event)">