jQuery keypress() method

Definition

Use the jQuery keypress() method to fire the keypress event i.e. when a keyboard key is pressed.

Syntax

The following is the syntax,

The following is the parameter for the keypress method,

  • func: When the keypress event is fired, this function runs. This is an optional parameter.

Example

The following is the output,

Press any key to change the background,

jQuery keydown() method
jQuery keyup() method
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading