radio选中的值获取
HTML:
<input type="radio" name="sex" id="sex" value="男" />男
<input type="radio" name="sex" id="sex" value="女" />女
获取:
js:var sex=$("input[name='sex']:checked").val();
多个单选框默认选中:
var radios=$("input[name='sex']");
if (res.sex=="男") {
radios.eq(0).attr("checked", true);
} else{
radios.eq(1).attr("checked", true);
}