📜  在 jquery 中按转义按钮激活事件 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:19.261000             🧑  作者: Mango

代码示例1
// 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.