I am currently utilizing the jQuery select2 plugin to enable multiple selections. My goal is to incorporate a checkbox for each selectable option.
Depending on whether the checkbox is checked or unchecked, the dropdown option should be selected accordingly.
Sample HTML:
<select multiple="multiple" id="e1" style="width:300px">
<option value="AL" selected> Alabama</option>
<option value="Am">Amalapuram</option>
<option value="An">Anakapalli</option>
<option value="Ak">Akkayapalem</option>
<option value="WY">Wyoming</option>
</select>
JS:
$("#e1").select2();