Capture Keystroke Using Jquery.js
anoopsachari | Apr 16, 2010 | Comments 0
Capture keystroke using jquery.js . Download and include jquery.js before you use the code .
The code check the ASCII value of the key pressed .
$(this).keydown(function(e) {
if (e == null)
{ // for IE
keycode = event.keyCode;
} else { // for mozilla
keycode = e.which;
}
if(keycode == 27){ // write your custom function
alert('Escape Pressed');
}
});
Execute the code and press Escape to see the magic .
Filed Under: javascript
About the Author: a holistic web developer , movie buff and technical blogger from queen of arabian sea.






