jlittlejohn
12/13/2012 - 9:26 PM

JS: Keystroke Events

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   
});