Using Keystroke events in JQuery

Posted by Goud.Kv under jQuery category on | Points: 40 | Views : 598
Below code snippet helps you to write Keystroke events in JQuery.

$('input').keydown(function(event) {

// variable event contains keystroke data

// that only accessible with .keydown()

if(event.which == 11) {

$('input').keyup(function(ee) {

// run other event codes similarly


'.keydown' is the event fires when you press a key in the keyboard, where as '.keyup' fires after releasing the key.

Comments or Responses

Login to post response