这看起来很愚蠢和愚蠢,但是我似乎无法弄清楚如何通过JavaScript检查HTML表单中单选按钮组的值。我有以下代码:
<input type="radio" id="genderm" name="gender" value="male" />
<label for="genderm">Male</label>
<input type="radio" id="genderf" name="gender" value="female" />
<label for="genderf">Female</label>
如何gender
通过JavaScript检索值?