81,092
社区成员
发帖
与我相关
我的任务
分享
<script type="text/javascript">
function getValue() {
var radios = document.getElementsByName('rad');
for (var i = 0; i < radios.length; i++) {
if (radios[i].checked) {
alert(radios[i].value);
break;
}
}
}
</script>
<input name="rad" type="radio" value="0" onclick="getValue()"/>0
<input name="rad" type="radio" value="1" onclick="getValue()"/>1
<input name="rad" type="radio" value="2" onclick="getValue()"/>2
<input name="rad" type="radio" value="3" onclick="getValue()"/>3