Answers for "activate an event on press escape button in jquery"

0

activate an event on press escape button in jquery

// You can use $.Event() to create an Event object containing a keydown event with the keyCode of 27 (which should be Esc) like:

var esc = $.Event("keydown", { keyCode: 27 });
$("body").trigger(esc); // change body to the element where you'd like to execute the escape key press.
Posted by: Guest on October-18-2020

Code answers related to "activate an event on press escape button in jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language