Started

Selectors

Animation

AJAX

CSS

Event

Manipulation

Cookie

String

Attributes

Data

Storage

Miscellaneous

$event.key

Return which key is pressed.
$event( event )
  1. event [event]
    The target event.

Notes

This function will return the key code from event. For example, the key code of ENTER is 13 and the key code of SHIFT is 16.

Example

HTML code
<input type="text" onkeyup="check_key(event)" />
<div id="box"></div>
JavaScript code
function check_key(event)
{
	$html( $("box"), "The key code of the key you pressed is " + $event.key(event) );
}
Demonstration