Created
December 13, 2012 21:26
-
-
Save jlittlejohn/4280086 to your computer and use it in GitHub Desktop.
JS: Keystroke Events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('input').keydown(function(e) { | |
// variable e contains keystroke data | |
// only accessible with .keydown() | |
if(e.which == 11) { | |
e.preventDefault(); | |
} | |
}); | |
$('input').keyup(function(event) { | |
// run other event codes here | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment