我在我的代碼中使用了搜索框。如何在引導搜索框中添加來自單詞列表的建議
<form action="/search" method="post" role="form">
<div id="custom-search-input" style="height:41px">
<div class="input-group col-md-12" style="height:10px">
<input id="search" name="search" type="text" class="form-control input-lg"
placeholder="Search" style="font-size:14px;height:30px"/>
<span class="input-group-btn">
<button class="btn btn-info btn-lg" type="submit">
<i class="glyphicon glyphicon-search" style="text-decoration:none"></i>
</button>
</span>
</div>
<div><label id="noresult"><i>No results found</i></label>
</div>
</div>
</form>
現在我想自動建議添加到該搜索框一樣,如果你寫「一」開始顯示一切從「a」一樣google.Those建議可以從包含每一個可能的列表加載可以搜索的結果。
請幫我看看如何添加此功能。
使用jQuery自動完成 - https://jqueryui.com/autocomplete/ –