Answers for "select2 event selected value"

12

select2.org events

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

select2 preselect option

$('#mySelect2').val('1'); // Select the option with a value of '1'
$('#mySelect2').trigger('change'); // Notify any JS components that the value changed
Posted by: Guest on November-09-2020
2

select2 find option by value

$('#Select2ID option[value="actualVal"]).text()
Posted by: Guest on September-17-2021

Code answers related to "select2 event selected value"

Code answers related to "Javascript"

Browse Popular Code Answers by Language