// Bind Enter key to search bar $("#MySearchBar").keypress(function (e) { if (e.keyCode === 13) { MyVoidFunction(); } });