Answers for "how to select select2 option in jquery"

3

Select options of Select2 control based on values using Jquery

$('#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 September-16-2021
1

get select2 selected value jquery

$('#id :selected').text();
Posted by: Guest on November-29-2021
0

jquery select2 multiple select all

$("#checkbox").click(function(){
    if($("#checkbox").is(':checked') ){
        $("select > option").prop("selected","selected");
    }else{
        $("select > option").removeAttr("selected");
     }
});
Posted by: Guest on September-15-2020

Code answers related to "how to select select2 option in jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language