I want my select box to dynamically change the CSS of another part of the page so that the right options are visible according to each selection.
E.g. the right DIV elements are shown when the correlating select option is selected.
My select input and DIVs:
<select id="chooser" class="input_select" name="chooser">
<option value="">Select...</option>
<option value="Car">Car</option>
<option value="House">House</option>
<option value="Commercial">Commercial</option>
<option value="Other">Other</option>
</select>
<div id="car" style="display:none;">Cars</div>
<div id="house" style="display:none;">House related</div>
<div id="commercial" style="display:none;">Commercial stuff</div>
<div id="other" style="display:none;">Other stuff</div>
my jquery so far:
$(document).ready(function() {
$('#chooser').change{
$('#house').hide()
$('#commercial').hide()
$('#other').hide()
$('#car').show()
}
});
I'm a noob at jQuery and I just don't know HOW to tell it to filter it by which option is selected. I mean, I think I added the .change{} part right but no idea how to filter it.
Any help is appreciated. Thanks