I have an HTML code with this line:
<input id="search" type="text" placeholder="Search">
And a JS file with those:
var arr = ["A", "B", "C", "D"];
$('#search').autocomplete({ source: arr });
I am trying to make a autocomplete for a search engine, But i cant display my results in my HTML Web page.
I was looking at some answers and seen people that says it work. Any idea why it doesnt work for me?
您使用的自动完成功能来自jqueryUI。是否包含了它?
您需要包括JQuery UI,而不仅仅是JQuery:
<script src="jquery-ui.min.js"></script>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.