I am trying to create a form which when the select element \'parcel\' is selected it will show a div but when it is not selected I would like to hide the div. Here is my mar
I used the following jQuery-based snippet to have a select-element show a div-element that has an id that matches the value of the option-element while hiding the divs that do not match. Not sure that it's the best way, but it is a way.
$('#sectionChooser').change(function(){
var myID = $(this).val();
$('.panel').each(function(){
myID === $(this).attr('id') ? $(this).show() : $(this).hide();
});
});
.panel {display: none;}
#one {display: block;}
Thing One
Thing Two
Thing Three