I have a javascript window.open popup, and I want the popup to close itself when the user presses the ESC key. I can\'t figure out how to hook the keydown event (and on wha
Try something like this:
$(document).keydown(function(e) { // ESCAPE key pressed if (e.keyCode == 27) { window.close(); } });