I've searched around and found multiple answers for this, but none of them have worked for me. I'm using a RadioButtonList inside a repeater control. Here is my jQuery function.
$("[name$='$PlanSelectionRbtnLst']").click(function () {
alert($(this).val()); //this works
$("[name$='$PlanSelectionRbtnLst']").find("input[value='-1']").attr("checked", true); // this doesn't
});
This is correctly alerting me the value I selected when I click on any radio button, but I am not able to change all of the RadioButtonList's selected button to the -1 value. If it matters, my script is in a master page.
EDIT: As requested, here a small snippet of the rendered html:
<table id="MainContent_BenefitsRpt_PlanSelectionRbtnLst_2>
<tbody>
<tr>
<td>
<input name="ct100$MainContent$BenefitsRpt$ct103$PlanSelectionRbtnList" id="MainContent_BenefitsRpt_PlanSelectionRbtnLst_2_0_2" type="radio" value="9"/>
</td>
<tr>
</tbody>