i have a set of radio buttons.
<ul class="ProductOptionList">
<li>
<label>
<input class="RadioButton" type="radio" value="157" name="variation[1]"/>
Lemon (200 ml)
</label>
</li>
<li>
<label>
<input class="RadioButton chosen" type="radio" value="160" name="variation[1]"/>
Lemon and Herbs (200 ml)
</label>
</li>
</ul>
i want to highlight the one that is selected.
i used this code:
$('input.RadioButton').click(function() {
var chkbox = $(this);
chkbox.is(':checked') ?
chkbox.addClass('chosen') : $chkbox.removeClass('chosen');
but if a person clicks one variation it works and applies the class, then if they click a second it applies the class to the second but doesnt remove the class from the first. how do i remove the class? thanks!