Home  >  Article  >  Web Front-end  >  In-depth analysis of jQuery's autocomplete component_jquery

In-depth analysis of jQuery's autocomplete component_jquery

WBOY
WBOYOriginal
2016-05-16 17:31:58925browse

简单实例

复制代码 代码如下:





AutocompleteOption














效果图:

在上述代码中,在页面初始化的时候将页面上的输入框包装成jQuery对象,然后使用autocomplete()方法将其包装成自动完成组件,同时初始化其最小响应长度选项和数据源选项
2:自动完成组件的方法
有Search, Open, Focus, Select, Close, Change事件
复制代码 代码如下:

   function(event, ui) {
      //event: 触发事件时的事件对象
    //ui, 是用户界面对象,ui.item是一个包含label和value属性的对象
  }

复制代码 代码如下:





AutocompleteEvent












 


 
 

My Search Engine





效果图:
  

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