Tagging support

In addition to the dropdown menu of options, Select2 can also allow free-text responses. This feature is called "tagging". To enable free-text responses, set the tags option to true:

{% highlight js linenos %} $(".js-example-tags").select2({ tags: true }) {% endhighlight %}

Note that when tagging is enabled the user can select from the pre-existing options or create a new option by picking the first choice, which is what the user has typed into the search box so far.

Tagging with multi-value select boxes

Tagging can also be used in multi-value select boxes. In the example below, we set the multiple="multiple" attribute on a Select2 control that also has tags: true enabled:

Try entering a value that isn't listed in the dropdown - you'll be able to add it as a new option!