| Author |
jQuery - deselect same name radio buttons
|
Rob Hunter
Ranch Hand
Joined: Apr 09, 2002
Posts: 788
|
|
|
I have 3 radio buttons on a page, after selecting one, an action is performed, and the 3 radio buttons get hidden until a user clicks a button to redisplay them. When they re-appear I want to have the radio buttons to be all unchecked as they initially were (all = with the same name, i.e. leaving all other radio buttons alone on the page). What's the easiest way to accomplish this in jQuery? Thanks.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56230
|
|
|
Remove the checked attribute from all of them. (Or try setting the checked attribute to Boolean false with the attr() method.)
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Rob Hunter
Ranch Hand
Joined: Apr 09, 2002
Posts: 788
|
|
|
Thanks for the reply Bear. I was wondering more along the lines of how to select all radio buttons with a particular name then I was going to use removeAttr("selected") on the results. $('input <what else is needed>').removeAtr('selected'). Thanks again.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56230
|
|
selected is for <options> not radio buttons. Use checked.
To select:
|
 |
 |
|
|
subject: jQuery - deselect same name radio buttons
|
|
|