例子,js 获取input按钮的值:
<input type= "radio" name="isEnd" value='1'>是
<input type= "radio" name="isEnd" value='0' checked=checked>否
<script type="text/javascript">
var isEnd;
function getRadioVal(){
var temp = document.getElementsByName("isEnd");
for(var i=0;i<temp.length;i++)
{
if(temp[i].checked){
isEnd = temp[i].value;
return isEnd;
break;
}
}
}
</script>