开发者

How to make a jQuery autocomplete's results go away immediately

开发者 https://www.devze.com 2023-01-25 07:57 出处:网络
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

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");
0

精彩评论

暂无评论...
验证码 换一张
取 消