Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

select2 clear options

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

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

Completly remove the select2 initialization :
--------------------------------------------
$('#payment_method').html('').select2({data: [{id: '', text: ''}]});
Comment

select2 clear selected

$("#mySelect2").select2({
    allowClear: true
});
Comment

select2 clear fields

$('#mySelect2').val(null).trigger('change');
Comment

PREVIOUS NEXT
Code Example
Javascript :: ajax multipart/form-data 
Javascript :: call javascript function use array 
Javascript :: substring method 
Javascript :: javascript split by backslash 
Javascript :: jquery $(document.on click 
Javascript :: change the mouse pointer javascript 
Javascript :: predicate function javascript 
Javascript :: string contains character javascript 
Javascript :: regex pattern for strong password 
Javascript :: mongodb add new field 
Javascript :: bootstrap modal clear all fields 
Javascript :: automatically scroll to bottom of page javascript 
Javascript :: nextjs process.env undefined 
Javascript :: download json file from s3 
Javascript :: angular cli generate component 
Javascript :: js find array return true false 
Javascript :: javascript absolute path 
Javascript :: moment js from now 
Javascript :: settimeout javascript see how much time is left 
Javascript :: chrome.tab.onupdated 
Javascript :: iterate object in react 
Javascript :: js generate random numbers 
Javascript :: jquery validation manually trigger 
Javascript :: javascript atualizar pagina 
Javascript :: javascript number format indonesia 
Javascript :: express how to refresh 
Javascript :: is object 
Javascript :: node exporter service 
Javascript :: quine 
Javascript :: datetime to date moment 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =