I\'m trying to implement key-press functionality which will remove a div when the user hits Esc. This works for Firefox & IE with the following code:
Esc
For ESC key:
$(document).keydown(function(e) { if(e.keyCode == 27) { /* Run code */ } }
For letter keys, like 'L':
$(document).keypress(function(e) { if(e.which == 108) { } });
Works in both Chrome and Firefox