I have a search box on my site. Currently, users must click the submit button next to the mail search box in jQuery. I would like users to also press enter to search. How can i do this?
Jquery:
$('document').ready(function(){ $('#searchButton').click(function(){ var search = $('#usersSearch').val(); $.post('../searchusers.php',{search: search},function(response){ $('#userSearchResultsTable').html(response); }); }); });
HTML:
<input type='text' id='usersSearch' /><input type='button' id='searchButton' value='search' />
jquery jquery-selectors
kirby Feb 05 '12 at 3:19 2012-02-05 03:19
source share