Answers for "select2 preselect option"

1

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

Code answers related to "Javascript"

Browse Popular Code Answers by Language