jQuery autocomplete filtering issue
问题 This is my code. I am trying to search only if user enter "[" symbol. But user can enter normal words also like hello. Example : Hello - no need to autocomplete. [Hello] - need to autocomplete. Here is the jsfiddle sample function split(val) { return val.split(/,\s*/); } function extractLast(term) { return split(term).pop(); } var availableTags = [ "[Hello]", "[Hello World]", "[Google", "[New Life]", "[World]", "[Old]" ]; $("#tags").autocomplete({ source: function(request, response) { //