解决方法
您可以触发它:
// dummy event listener $("input").keydown(function() { return true; }); var keyEvent = jQuery.Event("keydown"); keyEvent.keyCode = 13; $("input").trigger(keyEvent);
也看到这篇文章:Definitive way to trigger keypress events with jQuery