您好,欢迎访问一九零五行业门户网

javascript代码实现input输入框模糊提示功能

本文主要和大家介绍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> <p class="ui-widget"> <label for="tags">tags: </label> <input id="tags"> </p> </body>
效果:
相关推荐:
input标签输入框带提示文字方法
vue实现数字输入框中分割手机号码实例教程
js点击下拉菜单把选择的内容同步到input输入框内实现方法
以上就是javascript代码实现input输入框模糊提示功能的详细内容。
其它类似信息

推荐信息