how can I get value of unselected option in Select2 using select2:unselect
$('#mySelect').on("select2:unselect", function(e){
var unselected_value = $('#mySelect').val(); // using this shows 'null'
// or using below expression also shows 'null'
var unselected_value = $('#mySelect :selected').val();
alert(unselected_value);
}).trigger('change');
in above code alert shows 'null'
I need to use select2:unselect
because 'change' event will sense :select
and :unselect
both.