Created
October 19, 2018 14:51
-
-
Save johndhancock/ff44a424718b3bf7eb1b85f7cf05863d to your computer and use it in GitHub Desktop.
Esc key closing modal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.onkeydown = function(evt) { | |
| evt = evt || window.event; | |
| if (evt.keyCode == 27) { | |
| alert('Esc key pressed.'); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment