Posted By

wesleymacente on 04/06/09


Tagged

javascript keyevent esc


Versions (?)

Get key event ESC on document


 / Published in: JavaScript
 

  1. document.onkeydown = function(e){
  2. if (e == null) { // ie
  3. keycode = event.keyCode;
  4. } else { // mozilla
  5. keycode = e.which;
  6. }
  7. if(keycode == 27){ // escape, close box, esc
  8. //what you nedd
  9. }
  10. };

Report this snippet  

You need to login to post a comment.