new to jquery here, right now I have a working hide/show function when one radio button is selected. However, after I select a radio button there is no way to deselect all options and hide the div. Ideally id like to add a small ‘X’ that users could click which would reset my radio buttons and the amount of cars, I think you guys probably know just what I mean. Thanks a lot for the help!
html
<div id="myRadioGroup">
2 Cars<input type="radio" name="cars" value="2" />
3 Cars<input type="radio" name="cars" value="3" />
<div id="Cars2" class="desc">
2 Cars Selected
</div>
<div id="Cars3" class="desc">
3 Cars
</div>
</div>
jquery
$(document).ready(function() {
$("div.desc").hide();
$("input[name$='cars']").click(function() {
var test = $(this).val();
$("div.desc").hide();
$("#Cars" + test).show();
});
});
Does this answer what you wanted?