How can I close a modal popup on hitting escape?
This modal can be closed with the escape key on your keyboard. Note: You need to press the tab key on the keyboard to first enter the modal window, and then press the Esc key.
How to trigger escape key javascript?
$(document). on('keydown', function(event) if (event. key == "Escape") alert('Esc key pressed. '); );