Thursday, November 24, 2011

JavaScript Key Codes

http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes demystifies doing stuff like this in jQuery:

$('#SelectedSampleTypeId').keypress(function (e) {

   switch (e.keyCode) {

      case 38:

         whatever();

         break;

      case 40:

         whatever();

         break;

      case 13:

         whatever();

         break;

   }

});

No comments:

Post a Comment