I'm trying to uncheck a group of 2 radio buttons.
<label>Yes
<input type="radio" value="true" name="gasCustomer">
</label>
<label>No
<input type="radio" value="false" name="gasCustomer">
</label>
$(function () {
$('[name="electricCustomer"]').click(function () {
$('[name="gasCustomer"]').prop('checked', false);
});
});
I have tried using .prop('checked', false);
but this does nothing, with no console errors thrown.
I also can't seem to change the selected option to another option by giving each option and id and doing:
<label>Yes
<input type="radio" value="true" name="gasCustomer" id="gasCYes">
</label>
<label>No
<input type="radio" value="false" name="gasCustomer" id="gasCNo">
</label>
$(function () {
$('[name="electricCustomer"]').click(function () {
$("#gasCNo").prop('checked', true);
});