Skip to content

Instantly share code, notes, and snippets.

@jlittlejohn
Created December 13, 2012 21:26
Show Gist options
  • Save jlittlejohn/4280086 to your computer and use it in GitHub Desktop.
Save jlittlejohn/4280086 to your computer and use it in GitHub Desktop.
JS: Keystroke Events
$('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