I want to be able to uncheck a radio button by clicking on it.
So, if a radio button is unchecked, I want to check it, if it is checked, I want to uncheck it.
var checked = {}; $('.desectable-radio').each(function (index) { checked[index] = this.checked; $(this).click(function () { if (checked[index]) this.checked = false; for (var i in checked) { checked[i] = false; } checked[index] = this.checked; }); });