jquery search select option by text code example
Example 1: jquery select option by text
$("#myDropdown option:contains(Option 2)").attr('selected', 'selected');
Example 2: jquery search select option by text
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>