select2 disable code example
Example 1: select2 disable search
$("#js-example-basic-hide-search").select2({
minimumResultsForSearch: Infinity
});
Example 2: select2 search disable
$("#js-example-basic-hide-search").select2({
minimumResultsForSearch: -1
});
Example 3: select2 preselect option
$('#mySelect2').val('1');
$('#mySelect2').trigger('change');
Example 4: select2 full width
<select class="js-example-responsive" style="width: 50%"></select>
<select class="js-example-responsive" multiple="multiple" style="width: 75%"></select>