I have these codes
$('#search-button').keypress(function (e) {
if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
search();
};
});
$('#search-button').bind('click', function () {
search();
});
under the search module I have an alert, now whenever I press Enter when the button is in focus, the search() under the click event also triggers. Please help. Thanks.