Answers for "set value select 2"

4

select2 clear options

Remove the selected options : 
-----------------------------
$('#mySelect2').val(null).trigger('change');

============================================

Completly remove the select2 initialization :
--------------------------------------------
$('#payment_method').html('').select2({data: [{id: '', text: ''}]});
Posted by: Guest on July-30-2020
0

jquery to set value in select2 dropdown button

$("#u20_cre").select2().val(["1","6"]).trigger("change");
Posted by: Guest on January-09-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language