I have a table like so:
<table>
<tr>
<td>
<input type="radio" name="Sample1" id="Sample1" value="1" />
<input type="radio" name="Sample1" id="Sample2" value="1" />
</td>
<td>
<input type="radio" name="Sample2" id="Sample1" value="1" />
<input type="radio" name="Sample2" id="Sample2" value="1" />
</td>
etc....
</tr>
</table>
I want to be able to select a specific radio button by name and id. E.G., select the radio button with the name Sample2 and id Sample1. I tried doing this:
$('[id="Sample1"][name="Sample2"]').checked = true;
But no luck… How should I be doing this?
but elements can only have one id so maybe you want class instead of id
then your html
EDIT
made some changes here is a working demo