I want to be able to dynamically change what divs are show using radio button and jQuery - HTML:
<div id="myRadioGroup">
2 Cars<input type="radio" name="cars" checked="checked" value="2" />
3 Cars<input type="radio" name="cars" value="3" />
<div id="twoCarDiv">
2 Cars Selected
</div>
<div id="threeCarDiv">
3 Cars
</div>
</div>
and the jQuery:
<script>
$(document).ready(function(){
$("input[name$='cars']").click(function() {
var test = $(this).val();
$("div.desc").hide();
$("#"+test).show();
});
});
</script>
This does nothing , the divs always show. Im sure this is simple, but Im poor at jQuery .