/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
document.onkeydown = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // escape, close box, esc //what you nedd } };