<html>

<head>

<title>js+dom获得单选选项</title>
<script language="javascript" type="text/javascript">
    function hd(){
        var obj = document.getElementsByName("One");
        for(var i = 0;i < obj.length; i ++){
            if(obj[i].checked){
                alert(obj[i].value);
            }
        }
        
    }
    

</script>
</head>

<body>
<label>A<input type="radio" value="A" name="One" id="One"/></label>
<label>B<input type="radio" value="B" name="One" id="One"/></label>
<label>C<input type="radio" value="C" name="One" id="One"/></label>
<label>D<input type="radio" value="D" name="One" id="One"/></label>

<input type="button" value="获得" οnclick="hd()"/>
</body>

</html>