Form Select2
Basic
Use select2() function on select element to convert it to Select 2.
orangeNested
Add options inside the optgroups to for group options.
orangePlaceholder
Apply Placeholder by setting option placeholder option.
× Choose...Tagging with multi-value select boxes
Set tags:true to convert select 2 in Tag mode.
Small Select2
Use data('select2') function to get container of select2.
orangeDisabling options
Disable Select using disabled attribute.
FirstLimiting the number of Tagging
Set maximumSelectionLength:2 with tags:true to limit selectin in Tag mode.