jQuery keyup event With Example

jQuery keyup is one of the keyboard event methods. Other jQuery keyboard event methods are keydown() and keypress().

jQuery keyup

jQuery keyup method triggers when you release the pressed key. You can attach functions to execute when this event occurs.

jQuery keyup method syntax

  1. keyup(): This jQuery keyup method is used without any arguments.
  2. keyup(handler): This jQuery keyup method attaches a function to be executed when the keyup event is fired.

jQuery keyup example

Following example demonstrates the use of jQuery keyup method.

jquery-keyup.html

In above example, when the key is up, keyup() method is triggered which in turn executes the function that changes the background colour to red.

Below screencast shows above jQuery keyup example in action.

jquery keyup example

jQuery keyup demo

By admin

Leave a Reply