I recently found an answer to one of my questions here on stackoverflow which involved showing and hiding a div based on the value of a dropdown, here is the demo – http://jsfiddle.net/pXdS6/16/
My new question is, what if I wanted to show multiple divs with the same id based on the value
html like this:
<div id="divarea1" class="box">DIV Area 1</div>
<div id="divarea2" class="box">DIV Area 2</div>
<div id="divarea3" class="box">DIV Area 3</div>
<div id="divarea3" class="box">DIV Area 3</div>
If I select “DIV Area 3” from the dropdown I want both divs with #divarea3 to display
You cannot and should not have multiple DOM elements with the same id. Use classes. Use hundreds of classes (not really) if you have to, to group them.
Once you have the classes working,
This should do what you wanted to achieve.