I want to make a particular option selected with help of js code.
var selectElement = jQuery('[name="order_status"]').children();
console.log(selectElement);
jQuery(selectElement).each(function(index, item) {
var match = item.attributes.value.nodeValue;
if (progress === match) {
alert(match);
selectElement.innerHTML = progress;
//jQuery(this).empty().append(html);
}
});
<select name="order_status" class="select custom-select">
<option value="In Progress">In Progress</option>
<option value="Completed">Completed</option>
<option value="Rejected">Rejected</option>
</select>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>