Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经在下面的演示中使用了 jquery 组合框自动完成功能。
jquery组合框自动完成
当我按下回车按钮时,如何使 jquery 组合框自动完成自动选择建议的顶部项目?
所以用户不需要输入全文.. thx。
自动选择第一项的自动完成插件的扩展。只需将 selectFirst 选项设置为 true:
$('#auto').autocomplete({ selectFirst: true });
检查这个小提琴
http://github.com/scottgonzalez/jquery-ui-extensions/blob/master/autocomplete/jquery.ui.autocomplete.selectFirst.js