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
To handle both esc and enter key on dialog window.onkeydown = function(event) {
if(event.keyCode===27|| event.keyCode===13){ window.close(); } }