Home  >  Article  >  Web Front-end  >  Simple JS automatic prompt text box code_javascript skills

Simple JS automatic prompt text box code_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:57:031414browse

This example uses color as an example to provide automatic prompts for users. The display effect and running results are as follows:

1. Establish the frame structure:
Copy the code The code is as follows:



Color:




2. Page and form CSS:
Copy code The code is as follows:



3. Implement JS matching user input:
Copy code The code is as follows:



文本框输入提示/自动完成的Js代码
文本框输入自动匹配或提示的功能,输入内容,自动匹配对应数据,可用上下键控制选项、按回车键选择,也可以直接用鼠标选择。代码:建立实例,第一个参数是实例对象的名称,第二个是最多显示的数量。
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