设置单选框默认值 function setCheckedValue(radioName, newValue) {
if(!radioName) return;
var radios = document.getElementsByName(radioName);
for(var i=0; i<radios.length; i++) {
radios[i].checked = false;
if(radios[i].value == newValue.toString()) {
radios[i].checked = true;
}
}
}
获得单选框选中值 function getRadioValue(radioName){//得到radio的值
var obj=document.getElementsByName(radioName);
for(var i=0;i<obj.length;i++){
if(obj[i].checked){
alert(obj[i].value);
return obj[i].value;
}
}
}