Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
Source by select2.org #
 
PREVIOUS NEXT
Tagged: #Select #options #control #based #values #Jquery
ADD COMMENT
Topic
Name
3+4 =