这是我的 HTML
<tr>
<td class="g">
Gender
</td>
<td class="g_input">
<input type="radio" name="gender" id="settings_gender" value="Male" checked /> Male
<input type="radio" name="gender" id="settings_gender" value ="Female" /> Female
</td>
</tr>
这是javascript
$(document).ready(function () {
$(".update-basic-info").click(function () {
var gender = $("#settings_gender").val();
alert(gender);
});
});
输出只显示男性,当我检查女性单选按钮时,它仍然显示男性