Reputation: 595
According to here, the change event handler fires when the value changes. What about with mutually exclusive radio buttons? Selecting one button would set one button to "unchecked" and another to "checked". Would the change event handler fire for both of these elements?
EDIT: Nevermind, I found the answer.
Upvotes: 0
Views: 80
Reputation: 767
The change event will only fire on the radio you "checked", and if you use attr('checked', 'checked') to set/unset the radio, it will not fire the change event.
Upvotes: 0
Reputation: 582
It will fire for both, if you have event handlers on both radio buttons. But since they're mutually exclusive, you probably only need the listener on one of them, and get their states from that.
Upvotes: 0
Reputation: 604
Assuming these are two radio buttons with the same "name", you will only get one onChange event because only one field value is changing.
Upvotes: 1