javascript input输入框模糊提示功能的实现
2017-09-25 14:49
916 查看
javascript input输入框模糊提示功能的实现
主要用到了jQuery.autocomplete函数,定义好一个数组就可以用这个功能了,很方便。
<!doctype html> <html> <head> <meta charset="utf-8"> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="external nofollow" > <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <script> $(function() { var availableTags = [ "James", "Kobe", "Jordan" ]; $( "#tags" ).autocomplete({ source: availableTags }); }); </script> </head> <body> <div class="ui-widget"> <label for="tags">Tags: </label> <input id="tags"> </div> </body>
效果:
如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
您可能感兴趣的文章:
相关文章推荐
- Qt实现输入框,组合框提示,模糊查询,搜索关键字下拉提示功能
- 实现类似百度搜索框中模糊提示功能
- 实现输入内容提示的功能(仿google_百度输入框提示)jquery.ui.autocomplete.js插件
- 实现google那种输入框提示的功能
- 简单的js+css的输入框自动提示功能实现
- 实现输入内容提示的功能(仿google_百度输入框提示)jquery.ui.autocomplete.js插件
- 实现一个最简单的输入框提示功能
- 简单代码autocomplete="off"实现禁用input输入框的自动提示功能
- Android编程实现输入框动态自动提示功能
- html5实现输入框自动提示功能之------datalist标签
- js输入框邮箱自动提示功能代码实现
- html5实现输入框自动提示功能
- 页面输入框提示功能实现
- ASP.NET实验五:实现输入内容提示的功能(仿google_百度输入框提示)
- 用原生HTML5控件实现输入框自动提示(下拉列表补全)功能
- js输入框邮箱自动提示功能代码实现
- ASP.NET实验五:实现输入内容提示的功能(仿google_百度输入框提示)
- js输入框邮箱自动提示功能代码实现
- input输入框模糊提示功能
- ajax实时查库,实现输入框的自动完成提示框功能