I am using bootstrap-typeahead in order to allow multiple selection. Here is the demo.
The original code has been update by @Sherbrow Twitter bootstrap typeahead
Based on the default updater
method of typeahead :
updater: function (item) {
var pos = this.source.indexOf(item);
if(pos != -1) {
var newSource =
this.source.slice(0,pos)
.concat(this.source.slice(pos+1));
this.source = newSource;
}
return item
}
Demo with multiple values (jsfiddle)
Keep in mind that you can access this source from anywhere with $('sel').data('typeahead').source
considering that the typeahead is initialized