Link to home
Start Free TrialLog in
Avatar of jsissopainful
jsissopainfulFlag for United States of America

asked on

jquery how to get the values of a radio button

Dear Experts,

In the following suitation how do I get the selected value (apple) of the radio button using jquery?

I tried:

alert( $("answer") );
alert( $("answer").value );
alert( $("answer").text );

I am new to jquery and didnt find it in the API :(

<form>
<input name="answer" type="radio" value="cake">answer 1<br />
<input name="answer" type="radio" value="apple" checked>answer 2<br />
<input name="answer" type="radio" value="waterlemon">answer 3<br />
</form>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of shanikawm
shanikawm
Flag of Sri Lanka image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jsissopainful

ASKER

nice thank you :)