ドキュメント

Events/keyup

From jQuery JavaScript Library

Jump to: navigation, search

« Back to Events

keyup( )

Triggers the keyup event of each matched element.
This causes all of the functions that have been bound to the keyup event to be executed, and calls the browser's default keyup action on the matching element(s). This default action can be prevented by returning false from one of the functions bound to the keyup event. The keyup event usually fires when a key on the keyboard is released.

keyup( fn )

Bind a function to the keyup event of each matched element.
The keyup event fires when a key on the keyboard is released.
Arguments:
fnFunction
A function to bind to the keyup event on each of the matched elements.
function callback(eventObject) {
  this; // dom element
}
Examples:

To perform an action when the escape key has been released:

$(document).keyup(function(event){
    if (event.keyCode == 27) {
        alert('escaped!');
    }
});

NameType