I am trying to get the last selected item by listening to the select2:select event as suggested here, but I could not make it work.
Is this kind of event listening not supported?
$('#mySelect2').on('select2:select', function (e) {
// Do something
});
This does not work either:
$(document).on('select2:select', '#mySelect2', function (e) {
// Do something
});
But this works:
$('#mySelect2').change(function (e) {
// Do something
});
(select2 version 4.x)
I am trying to get the last selected item by listening to the
select2:selectevent as suggested here, but I could not make it work.Is this kind of event listening not supported?
This does not work either:
But this works:
(select2 version 4.x)