Is there some event for a radio button being selected?
I know I can use “click” but I believe it is possible to style radio buttons in some browsers such that clicking an outter area of a radio button might not select the radio button.
What event should I use?
It depends when you want to be informed of the event.
If you want to know immediately, go with
click. IE updates the state ofcheckedbefore the handler function is called, and I think the other browsers do as well. You may want to double check as I only have IE to work with right now.If you only need to know before something else happens, you can use
change. IE will not fire thechangeevent until the selected radio button loses focus. FF/chrome/others may fire the event without focus changing, but I believe IE is actually doing it right in this case.