if ($('#term :selected').val() > 0 && $('#season :selected').val() > 0) { var $sel = '#slide_' + season + term; $('[id^="slide_"]').css({display:'none'}) $($sel).css("display", "block"); }