I have 2 radio buttons wrapped in a fieldset. I want to get the value of the clicked radio button inside the fieldset when it is clicked.
HTML:
<fieldset id="skin-complexion" name="properties[skin_complexion]">
<img src="{{ 'icon-fair.png' | asset_url }}">
<input type="radio" value="Fair" />
Fair
<img src="{{ 'icon-medium.png' | asset_url }}">
Medium
<input type="radio" value="Medium" />
</fieldset>
jQuery:
$('#skin-complexion').on('change', function() {
var value = $(this).val();
alert(value);
});
My jQuery code above is not working. Any help is appreciated.
$('#skin-complexion input')
?