I have a jQuery autocomplete field on one of my pages. When I'm focused on the autocomplete field and I hit tab, it takes a little bit for the list of results to go away. Also, if I hit enter in the autocomplete field, the results stick around forever.
Is there an easy, preferably built-in way to make the result list go away immediately when the field loses focus or when I press enter? I could write my own solution by observing the blur and keypress events but it seems like something 开发者_StackOverflow社区that would probably already be out there.
$(".ac_results").css("display", "none");
精彩评论