📅  最后修改于: 2022-03-11 15:04:19.261000             🧑  作者: Mango
// 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.