javascript input輸入框模糊提示功能的實現
主要用到了jQuery.autocomplete函數,定義好一個數組就可以用這個功能了,很方便。
<!doctype html><html><head> <meta charset="utf-8"> <link rel="stylesheet" rel="external nofollow" > <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script src="http://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>效果:

如有疑問請留言或者到本站社區交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
新聞熱點
疑難解答