//单选
var onequestion = document.getElementByName("onequestion");
for(var i = 0; i<onequestion.length; i++){
if(onequestion[i].checked){
var onequestionvalue = onequestion[i].value;
}
}
//多选
var twoquestion = document.getElementByName("twoquestion");
twoquestionvalue = [];
for(var i2 = 0; i2<twoquestion.length; i2++){
if(twoquestion[i2].checked){
twoquestionvalue.push(twoquestion[i2].value);
}
}
var twoquestionvalues = twoquestionvalue.toString();
js 获取单选多选框选中值
于 2022-05-27 16:33:07 首次发布