Home >Web Front-end >JS Tutorial >A simple Autocomplete example implemented in JS_javascript skills

A simple Autocomplete example implemented in JS_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 16:52:151678browse

Share an auto-complete source code that I accidentally discovered. When testing here, we use an array. When actually using it, we can change it to the method of getting it from the server through Ajax and it will be OK.

Tip: You can save it directly to an html file to view the effect.

Copy code The code is as follows:






Autocomplete Function




<script><br> var autoComplete= new AutoComplete('o','auto',['b0','b12','b22','b3','b4','b5','b6','b7','b8','b2 ','abd','ab','acd','accd','b1','cd','ccd','cbcv','cxf']);<br></SCRIPT>




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn