Easy Tutorial
❮ Ajax Ajaxsetup Sel Odd ❯

jQuery keyup() Method

jQuery Event Methods

Example

Set the background color of an <input> field when a keyboard key is released:

$("input").keyup(function(){
    $("input").css("background-color","pink");
});

Definition and Usage

The sequence of events related to the keyup event:

The keyup event occurs when a keyboard key is released.

Tip: Use the event.which property to return which key was pressed.


Syntax

Trigger the keyup event for the selected elements:

Attach a function to the keyup event:

Parameter Description
function Optional. Specifies the function to run when the keyup event is triggered.

More Examples

Determine which key was pressed


jQuery Event Methods

❮ Ajax Ajaxsetup Sel Odd ❯