您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

javascript input输入框模糊提示功能详解

2025/2/11 4:51:06发布20次查看
这篇文章主要介绍了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>
效果:
以上就是javascript input输入框模糊提示功能详解的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product