I have a group of radio buttons and I want to add functionality that allows a user to deselect all radios by clicking on the radio that is currently selected.
E.g. by default the first radio is checked. The user then clicks on the second radio which then becomes select. The user now decides that actually no radio should be selected at all and clicks the second radio again to remove all selections.
The problem is that with a change
or click
event I'm not able to determine of a radio was checked before the user clicked it.
Is there a way to determine if a radio button was previously checked or not?