I have these radio buttons.
<input type="radio" id="flip" name="flip" value="Head" checked="checked" /> Head
<input type="radio" id="flip" name="flip" value="Tail" /> Tail
I am trying to process a form with ajax for which I tried to get the value of these radio buttons with this
var dataString = {
flip: $("#flip").val()
};
console.log(dataString.flip);
Now when I do console.log
to check the value its sending I am always getting Head
and not Tail even if I select Tail as a choice. Can anyone help me as why is it so?