I'm trying to have an alert box show the value of the radio option I have selected. HTML:
<input type="radio" name="sex" value="Male" /> Male<br />
<input type="radio" name="sex" value="Female" /> Female
When I choose one of those and set up and alert box to show me what i choose (as a test), it doesn't work.
I know that other people are telling to set this up like:
var sex = $('input[name=sex]:checked').val();
However, when i put that, the entire script just craps on itself. Nothing works. The script I have before looked like:
var sex = $('input[name=sex]:checked');
and with that the script still worked, but the alert only showed "[object Object]". What am i doing wrong?