Automatic tokenization

Select2 supports ability to add choices automatically as the user is typing into the search field. Try typing in the search field below and entering a space or a comma.

The separators that should be used when tokenizing can be specified using the tokenSeparators options.

{% highlight js linenos %} $(".js-example-tokenizer").select2({ tags: true, tokenSeparators: [',', ' '] }) {% endhighlight %}