Answers for "select2 js on change"

2

select2.org events

$('#mySelect2').on('select2:select', function (e) {
    var data = e.params.data;
    console.log(data);
});
Posted by: Guest on July-20-2020
0

select2 select value in not changing

any .val() updates need to be followed by
$('#unit').val('21'); // Select the option with a value of '21'
    $('#unit').trigger('change'); // Notify any JS components that the value changed
Posted by: Guest on July-24-2021

Browse Popular Code Answers by Language