In Javascript code on the browser, given the name
of a group of radio buttons, is there a way to directly find out which button is checked without iterating through each button one by one to check its checked
property?
Asked
Active
Viewed 36 times
-1

Old Geezer
- 14,854
- 31
- 111
- 198
1 Answers
0
Yes with jQuery. If the name of the group is state
, then:
$("[name=state]:checked").val()

Old Geezer
- 14,854
- 31
- 111
- 198