Answers for "how to clear select2 dropdown in jquery"

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
1

jquery clear select 2

$('select2element').val(null).trigger("change")
Posted by: Guest on April-12-2021

Code answers related to "how to clear select2 dropdown in jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language