I have select2 multi select field in my form where I want to remove the selected option from the dropdown list after it is selected and again add it to the list if it is removed
Remove (UnSelect) item from select2 multiple selected items
first step: add 'multiple' css class to your select2 element to get the true element which you want
$('select.multiple').on('select2:selecting', function (e) {
var select = this;
var idToRemove = '0';
var selections = $(select).select2('data');
var Values = new Array();
for (var i = 0; i < selections.length; i++) {
if (idToRemove !== selections[i].id) {
Values.push(selections[i].id);
}
}
$(select).val(Values).trigger('change');
});