:selected selector select2 code example
Example 1: select2
$('.js-example-basic-single').select2({
placeholder: 'Select an option'
});
Example 2: select2 .select2-results .select2-highlighted
$(document).ready(function() {
$("#menuOption1").select2({dropdownParent: "#menuOption1-container"});
$("#menuOption2").select2({dropdownParent: "#menuOption2-container"});
});