Make button respond to the Enter Key
问题 I have a button on my form, and when the button is clicked, it takes the value of a textbox and populates that value into a list. Usually, when someone hits the enter key on a form, then the form is submitted but I have written this to stop that behavior: $(document).on("keypress", "form", function(event) { return event.keyCode != 13; }); But, now I would like the functionality of the Enter key to be used for the purpose of the button on the form. As of now I have this code (based on the