It is necessary that when typing characters in the input, knocked out the search results for the json array, in this very input. For this, I used the library "ui.autocomplete". But something does not work, I can not understand the reason. Who has already worked with this library, tell me what is wrong.
Below I present my script to illustrate the problem:
<input type="text" id="myinput"> $("#myinput").autocomplete({ minLength: 0, source: projects, focus: function(event, ui) { $("#myinput").val(ui.item.data.allBrand); return false; }, select: function(event, ui) { $("#myinput").val(ui.item.data.allBrand); $("#myinput-id").val(ui.item.data.allBrand); $("#myinput-description").html(ui.item.data.allBrand); $("#myinput-icon").fadeOut('slow', function() { $(this).attr("src", "images/" + ui.item.icon).fadeIn('slow'); }); return false; } }) .data("autocomplete")._renderItem = function(ul, item) { return $("<li></li>") .data("item.autocomplete", item) .append("<a>" + item.label + "<br>" + item.desc + "</a>") .appendTo(ul); }; }) Here is the version with the library connected: http://jsfiddle.net/t52ka/39/