$(document).keydown(function(event) {if (event.keyCode || event.which === 13) {// Cancel the default action, if neededevent.preventDefault();// Call function, trigger events and everything you want to do. Example: Trigger the button element with a click$("#btn").trigger('click');}})
$(document).keydown(function (event) {//proper indentiation of keycode and which to be equal to 13.if ( (event.keyCode || event.which) === 13) {// Cancel the default action, if neededevent.preventDefault();//call function, trigger events and everything tou want to dd . ex : Trigger the button element with a click$("#btnsearch").trigger('click');}});