$('#material').on('change', function() { $('#wrap>div').hide(); if (this.value) $('#wrap>div.'+this.value).show(); });