I have a Drop down box Based on the selection i should populate the content specific to that year. At any time i can only populate one year content and i need to hide the rest of content based on the selection. How should i code this using Jquery
<div style="margin:4px 0 0 0;">
<label> Select Year </label>
<select name="select_Release">
<option value="2011">2011</option>
<option value="2010">2010</option>
<option value="2009">2009</option>
<option value="2008">2008</option>
<option value="2007">2007</option>
<option value="2006">2006</option>
<option value="2005">2005</option>
</select>
</div>
<div>Some 2011 content to display</div>
<div>Some 2010 content to display</div>
<div>Some 2009 content to display</div>
<div>Some 2008 content to display</div>
<div>Some 2007 content to display</div>
<div>Some 2006 content to display</div>
<div>Some 2005 content to display</div>
Working example here: http://jsfiddle.net/FDpmb/1/
jQuery:
Slightly modified markup (Note the
idon your select box, and the extradivtag anddata-yearattributes):