0

i want to retrieve the value of radio button, here how they look

"<td width=70% align=left class=WizardBodyFont><input type=radio name=gender id=gender value=""M"" checked>Male" & vbcrlf
        g_strBodyText = g_strBodyText & "&nbsp;&nbsp;&nbsp;&nbsp;<input type=radio name=gender id=gender value=""F"">Female</td></tr>" 

I'm trying to retrieve the radio button value based on ID like below in my javascript & its not working.

 gendernode = fraWizard.document.frmWizard.getElementById("gender");

If i try to get the values based on Tag name its working fine

var txts = fraWizard.document.frmWizard.getElementsByTagName("input")

How to retrieve the value by ID.

Naruto
  • 9,476
  • 37
  • 118
  • 201

1 Answers1

1

You can get the value using getElementsByName:

gender_value = document.getElementsByName("gender").value;