JS监听用户按下ESC $(document).ready(function(){}).keydown(function (e) { if (e.which === 27){ //自定义逻辑 } });