How to realize in jquery that pressing enter triggers a button event, and clicking the submit button triggers an event, and writes these two events into one event:
//Button event
$('#btnSumit').click(function() {alert('test')});
//Enter to submit the event
$("body").keydown(function() {
if (event.keyCode == "13") {//keyCode=13 is the enter key
$('#btnSumit').click( );
}
});
//--------Enter to submit event completion ------------------//