http://jsfiddle.net/0n04s1Ls/1/
HTML:
<input type="radio" name='abc1' class="rad" /> <input type="radio" name='abc2' class="rad" /> <input type="radio" name='abc3' class="rad" />
Js:
$('.rad').mousedown(function () { $(this).data('checked', $(this).prop('checked')); }).click(function () { var checked = $(this).data('checked'); $('.rad').prop('checked', false); $(this).prop('checked', !checked); });
Task: do not give to choose more than one input. Give the ability to deselect. It seems that this shit. But I don’t know how to significantly improve it.
My options are:
1) Still, to call them one name - no need for everyone to put false;
2) use the checkbox - the need to check the status of the input will disappear, but everyone will have to put false;
Is there a human solution?