Tell me how to display all the values in the array containing the word "analyst", in my example, only the values for the first word are shown, it is necessary that all values containing the word "analyst" are shown here http://jsfiddle.net/UKgD6/246/
var acList = ['smart analyst', 'analyst oversmart', 'smartland analyst', 'undersmart analyst', 'analyst verysmart', 'cool analyst smarter' ]; $('#ac').autocomplete({ source: function( request, response ) { var matches = $.map( acList, function(acItem) { if ( acItem.toUpperCase().indexOf(request.term.toUpperCase()) === 0 ) { return acItem; } }); response(matches); } <input id="ac">