获取Radio选中的值
<input type="radio" name="advancedBespeak" value="1">是
<input type="radio" name="advancedBespeak" checked="checked" value="0">否
JS代码
var advancedBespeakRadio=document.getElementsByName("advancedBespeak");
for(var i=0;i<advancedBespeakRadio.length;i++){
if(advancedBespeakRadio[i].checked==true) {
alert(advancedBespeakRadio[i].value);
}
}
获取CheckBox选中的值
<input type="checkbox" id="product" value="1">Apple
JS代码
var product=document.getElementById("product");
if(product.checked==true) {
alert(product.value);
}