I am trying like below to get the value of a checked radio button but it just keeps giving undefined. I am using Firefox on Ubuntu so I don’t know if its some weird quirk of the browser or what, I would appreciate any advice as this is driving me crazy:
<input name="tagRow_ddd" type="radio" value="p">
<input name="tagRow_ddd" type="radio" value="r">
alert($('input[name=tagRow_ddd]:checked').val())
Jfiddle: http://jsfiddle.net/fD7fP/6/
that’s exactly the output it should give. the
:checkedselector only finds checked elements… you haven’t any.http://jsfiddle.net/fD7fP/7/