Reputation: 63
I am using the select2 plugin version 3.5.2. I am using the multiple select. Now suppose I selected a value from the dropdown list and then removed it again by clicking on the cross icon, how can I know its value ?
Upvotes: 0
Views: 669
Reputation: 5224
Select2 provides different events that you can use to catch selection, removal or other events. For your case you can use select2-removed
event,
$("#multipleSelectExample").on("select2-removed", function(e) {
alert(e.val);
})
Here is an working JSFiddle.
Also, I suggest you to use latest version of Select2 if possible as they have added tons of new features that you can work on with.
Upvotes: 2