I have this array,
var metrics = [ { value: "1", label: "Sold Listings", desc: "sold_listings" }, { value: "10", label: "New Pendings", desc: "new_pendings" }, { value: "4", label: "All Pendings", desc: "all_pendings" }, { value: "2", label: "New Listings", desc: "new_listings" }, { value: "3", label: "Active Listings", desc: "active_listings" } ];
What I wanted to do was select the Selected element, for example, I will select Active Listings, this element should be removed from the array. So when autocomplete is displayed again, it will not display the selected item.
//My Idea of removing the item $.each(metrics,function(i,val){ if(val.value == ui.item.value){ delete metrics[i]; } });
source share