A simple jquery ui autocomplete
by Ea Bangalore
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css">
<div class="ui-widget">
<label for="tags">Search: </label>
<input id="tags">
</div>
JavaScript
$(function() {
var availableTags = [
{label:"john",anyotherFields:"hhha1"},
{label:"khair",anyotherFields:"hhha2"},
{label:"compton",anyotherFields:"hhha3"},
{label:"Jordan",anyotherFields:"hhha4"},
];
$( "#tags" ).autocomplete({
source: availableTags,
select: function(e,ui){
console.log('ui',ui.item);
}
});
});