Skip to main content

Option Groups

Selectize provides the ability to group options together within the dropdown menu.

Html
<select id="select-gear" class="demo-default" multiple placeholder="Select gear...">
<option value="">Select gear...</option>
<optgroup label="Climbing">
<option value="pitons">Pitons</option>
<option value="cams">Cams</option>
<option value="nuts">Nuts</option>
<option value="bolts">Bolts</option>
<option value="stoppers">Stoppers</option>
<option value="sling">Sling</option>
</optgroup>
<optgroup label="Skiing">
<option value="skis">Skis</option>
<option value="skins">Skins</option>
<option value="poles">Poles</option>
</optgroup>
</select>

Javascript
$('#select-gear').selectize({ sortField: 'text' })