Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 30th, 2012  |  syntax: None  |  size: 0.30 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Why won't keyup() and keydown() play nicely together?
  2. $(document).keyup(function (event) {
  3.     alert('Keyup');
  4. });
  5. $(document).keypress(function(e) {
  6.     alert('Keypress: ' + String.fromCharCode(e.which));
  7. });
  8. $(document).keydown(function(e) {
  9.     alert('Keydown: ' + String.fromCharCode(e.which));
  10. });