Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #preselect #option
ADD COMMENT
Topic
Name
4+4 =