var radios = document.YourFormName.YourRadioName;
var value;
for (var i=0; i < radios.length; i++)
 if (radios[i].checked)
    value = radios[i].value;alert(value);

解决方案 »

  1.   

    <html>
    <head>
    <script language="javascript">
      function chk() {
         var i = parseInt(document.form1.text1.value, 10);
         document.form1.radio1[i].checked = true;
      }
    </script>
    </head>
    <body>
    <form name="form1">
    <input type="radio" name="radio1">radio test 0<br>
    <input type="radio" name="radio1">radio test 1</br>
    输入你想选择的radio(从0开始)
    <input type="text" name="text1" value=""><br>
    <input type="button" value="select" onclick="chk()">
    </form>
    </body>
    </html>