javascript input输入框模糊提示功能的实现
更新时间:2017年09月25日 14:49:57 作者:Lovnx
这篇文章主要介绍了javascript input输入框模糊提示功能的实现的相关资料,希望通过本能帮助到大家,需要的朋友可以参考下
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>
效果:
如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
相关文章
In Javascript Class, how to call the prototype method.(three
In Javascript Class, how to call the prototype method.(three method)...2007-01-01javascript iframe中打开文件,并检测iframe存在否
从iframe中打开文件,并检测iframe存在否如果说只是检测页面存在否,直接设置target用伪协议就可以解决了...2008-12-12bootstrap table.js动态填充单元格数据的多种方法
这篇文章主要为大家详细介绍了bootstrap table.js填充单元格数据的多种方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2019-07-07
最新评论