select2 dropdown set value code example
Example 1: jquery to set value in select2 dropdown button
$("#u20_cre").select2().val(["1","6"]).trigger("change");
Example 2: how to set value select2
$('#sel_users').select2().trigger('change');
$(document).ready(function(){
// Initialize Select2
$('#sel_users').select2();
// Set option selected onchange
$('#user_selected').change(function(){
var value = $(this).val();
// Set selected
$('#sel_users').val(value);
$('#sel_users').select2().trigger('change');
});
});