日期:2014-05-16 浏览次数:20957 次
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<input type="radio" name="yhk" value="1001" checked="checked"/>
<input type="radio" name="yhk" value="1034" />
<input type="radio" name="yhk" value="1005" />
<input type="radio" name="yhk" value="1008" />
<input type="button" onclick="cz();" value="获取radio选中的值">
<script>
function cz(){
var url = '';
var r=document.getElementsByName("yhk");
for(var i=0;i<r.length;i++){
if(r[i].checked){
alert(r[i].value);
}
}
}
</script>
</body>
</html>