$(document).keyup(function(event) { if(event.keyCode == 27) { // Capture Esc key doSuperSpecialFunction(); } });
With this script anytime a key is pressed and goes up in the body of the document, the function specified runs. Simply replace the keyCode number (27, above) with the number that corresponds to your key (like 13 for enter or 8 for backspace). Remember, you must have jQuery "installed" in order for this to work.
1 comment:
thanks :)
Post a Comment