//get all selected select object
$('#select2Id').find(':selected');
//get all selected value
$("#select2Id").select2("val");
<select id="lang" >
<option value="1">php</option>
<option value="2">asp</option>
<option value="3">java</option>
</select>
<script>
$("#lang").select2().select2('val','1');
</script>
$('#mySelect2').val('1'); // Select the option with a value of '1'
$('#mySelect2').trigger('change'); // Notify any JS components that the value changed
$('#id :selected').text();
$('#mySelect2').val(['1', '2']);
$('#mySelect2').trigger('change'); // Notify any JS components that the value changed
$('#inputID').select2('data', {id: 100, a_key: 'Lorem Ipsum'});
$('#all_contacts').select2('data', {id: '123', text: 'res_data.primary_email'});