I am trying to get id from a set of radio buttons. Here is the HTML for it.
<input id="1" type="radio" title="2" value="6/1/2010" name="vacationDay">
<input id="2" type="radio" title="2" value="6/2/2010" name="vacationDay">
<input id="3" type="radio" title="2" value="6/3/2010" name="vacationDay" checked='checked'>
Here is my Javascript.
var updateDay = $('input[name=vacationDay]:checked').val();
It returns the value (6/3/2010) of the selected switch. I would also like to get the identifier of the checked button (3). Ideas?
source
share