I have 2 groups raido buttons, they have different unique IDs, how to make they can be selected only one for each group. Thanks
<group>
<input type="radio" id="u1"/>1
<input type="radio" id="u2"/>2
<input type="radio" id="u3"/>3
</div >
</group>
<group>
<input type="radio" id="T1"/>4
<input type="radio" id="T2"/>5
<input type="radio" id="T3"/>6
</group>
I don’t want to change the html, just want to use jQuery to achieve
If you really must use the existing HTML, then I’d suggest amending the HTML via jQuery to simply use the default functions of a radio input:
JS fiddle demo.
References:
attr().each().