Responding to keyboard events
This recipe demonstrates how to write an event handler for a common keyboard event, keyup
, which is triggered when a key is released. The constructs used in this example are as follows:
Construct |
Type |
Description |
---|---|---|
|
jQuery selector |
This selects an element using its ID. |
|
jQuery object |
This refers to the current jQuery object. |
|
jQuery method |
This adds the specified CSS class to each matched element. |
|
jQuery event |
This is fired when a key is released. It corresponds to the JavaScript |
|
JavaScript property |
This returns the length of the string. |
|
jQuery event binder |
This attaches an event handler for one or more events to the matched elements. |
|
jQuery method |
This returns the value of the specified property for the first matched element or sets the value of the specified property for all matched elements. |
... |