您需要使用autocomplete jquery 来执行此操作...
试试这个chosen jquery library 我也在我的应用程序中使用相同...
http://davidwalsh.name/jquery-chosen
http://harvesthq.github.io/chosen/
也检查一下..
http://jqueryui.com/autocomplete/
https://github.com/dyve/jquery-autocomplete
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Ruby",
"Scala",
];
$( "#tags" ).autocomplete({
source: availableTags
});
});
</script>
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags">
</div>
把这个代码...你需要创建一个array来获得autocomplete的工作..它没有自己的想法去思考建议
来自 jqueryui.com/autocomplete/ 的参考