I have a drop-down and need to show hidden div that corresponds to the selected option and do nothing when a blank option is selected:
$("#hiddenDiv1").hide();
$("#hiddenDiv2").hide();
$('#mySelector').change(function() {
});
<select id="mySelector">
<option>select one option</option>
<option value="option1">option 1</option>
<option value="option2">option 2</option>
</select>
<div id="hiddenDiv1">aaaaa</div>
<div id="hiddenDiv2">bbbbb</div>
That’s as far as I was able to get on my own.
An alternative to Emmanuel’s answer:
Edit
Since there seems to be some desire to turn this into a bit of code golf, here’s my reduced-line-count version (no changes to the OP’s markup):
jsfiddle demo →