Javascript-js or jquery How to quickly query data?

Source: Internet
Author: User
Such as:

var data = [ajax过来的数据]

The front-end user types characters in the input box and JS/JQ quickly matches the data that matches the prefix.
For example, if you type seg, you will quickly match the corresponding data entry that begins with the seg .

*数据是json格式的php数组*类似于SegementFault站内邀请别人答题时候输入框的效果

Reply content:

Such as:

var data = [ajax过来的数据]

The front-end user types characters in the input box and JS/JQ quickly matches the data that matches the prefix.
For example, if you type seg, you will quickly match the corresponding data entry that begins with the seg .

*数据是json格式的php数组*类似于SegementFault站内邀请别人答题时候输入框的效果

First one, AutoComplete.
http://jqueryui.com/autocomplete/

This should be able to meet your requirements.
The demo on the homepage is the same as what you mean.

Alternative options:
Http://ivaynberg.github.io/select2/index.html

AutoComplete

jQueryUI's AutoComplete

Typeahead.js

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.