Description: For key or button events, this attribute indicates the specific button or key that was pressed.
event.which
normalizes event.keyCode
and event.charCode
. It is recommended to watch event.which
for keyboard key input. For more detail, read about event.charCode on the MDC.
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<input id="whichkey" value="type something">
<div id="log"></div>
<script>$('#whichkey').bind('keydown',function(e){
$('#log').html(e.type + ': ' + e.which );
}); </script>
</body>
</html>
"keydown" 74