JQuery UI Instance-AutoComplete (Autocomplete)

Source: Internet
Author: User
Tags jquery ui autocomplete

Http://www.runoob.com/jqueryui/example-autocomplete.html

Customize the data and show that you can use a custom data format and display the data by simply overloading the default focus and selection behavior. Try to type"J", or press the DOWN ARROW key to get a list of items. <!doctype html>"en">"Utf-8"> <title>jquery UI AutoComplete (Autocomplete)-Customizing data and displaying </title> <link rel="stylesheet"href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <link rel="stylesheet"href="Http://jqueryui.com/resources/demos/style.css"> <style>#project-label {display:block; Font-Weight:bold; Margin-bottom:1em; } #project-Icon {float: Left;    height:32px;  width:32px; } #project-Description {margin:0; padding:0; }  </style> <script>$ (function () {varProjects =[{value:"jquery", Label:"JQuery", desc:"The write less, does more , JavaScript library", Icon:"Jquery_32x32.png"}, {value:"Jquery-ui", Label:"jQuery UI", desc:"The official user interface library for JQuery", Icon:"Jqueryui_32x32.png"}, {value:"Sizzlejs", Label:"Sizzle JS", desc:"a pure-javascript CSS selector engine", Icon:"Sizzlejs_32x32.png"      }    ]; $( "#project"). AutoComplete ({minLength:0, Source:projects, Focus:function (Event, UI) {        $( "#project"). Val (Ui.item.label); return false; },      Select: Function (Event, UI) {        $( "#project"). Val (Ui.item.label); $( "#project-id"). Val (Ui.item.value); $( "#project-description"). HTML (UI.ITEM.DESC); $( "#project-icon"). attr ("src","images/"+Ui.item.icon); return false; }}). Data ("Ui-autocomplete"). _renderitem =function (UL, item) {return$("<li>"). Append ("<a>"+ Item.label +"<br>"+ Item.desc +"</a>"). APPENDTO (UL);  };  }); </script>"Project-label"> select an item (please type"J"): </div>"Project-icon"Src="Images/transparent_1x1.png" class="Ui-state-default"alt=""><input id="Project"><input type="Hidden"Id="Project-id"><p id="project-description"></p> </body>

JQuery UI Instance-AutoComplete (Autocomplete)

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.