I want to hide only those select box which has a null value selected. I have following HTML and jQuery
You can use the atrribute selector to find elements that have a selected value :
$('.date-month option[selected="selected"]').parent().hide();
Show/hide selects :
$('.date-month').each(function() {
if ($(this).find('option[selected="selected"]').length>0) {
$(this).hide();
} else {
$(this).show();
}
});