jQuery UI은 auto complete 구성 요소로 사용하는 것이 좋습니다.
미리 정의 된 로컬 데이터 목록을 보거나 사용자가 입력 할 때 실시간 검색을 수행 할 수 있습니다.
정적 조회를 사용하여 간단한 예를 들어 아래의 코드는 다음과 같습니다
<script>
$(function() {
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$("#tags").autocomplete({
source: availableTags
});
});
</script>
<div class="demo">
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags">
</div>
</div><!-- End demo -->
<div class="demo-description" style="display: none; ">
<p>The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are tags for programming languages, give "ja" (for Java or JavaScript) a try.</p>
<p>The datasource is a simple JavaScript array, provided to the widget using the source-option.</p>
</div><!-- End demo-description -->
감사합니다. 자동 완성 기능이 상당히 좋아 보인다. 내가 일할 수 있는지 알게 될거야. – aknuds1
동적 검색을 제공하기위한 제안이 있으십니까? – aknuds1
그건 당신이 코드를 작성하는 데 필요한 것입니다. @ Nicholas-Murray는이 측면을 설명하는 답변에서 링크를 제공합니다. –