<input type="radio" name="aa" value="y" onclick="alert(document.form1.aa.value)">

解决方案 »

  1.   

    sorry,i have make a mistake,the following code is right:<html>
    <head>
    <SCRIPT language=JavaScript type=text/JavaScript>
    <!-- 
    function tt(){
    if (document.form1.aa[0].checked){
      alert(document.form1.aa[0].value);
    }
    else if (document.form1.aa[1].checked){
      alert(document.form1.aa[1].value);
    }
    }
    //-->
    </script>
    </head>
    <body>
    <form name="form1">
    <input type="radio" name="aa" value="y" onclick=tt()>
                  是 
                  <input type="radio" name="aa" value="n" checked onclick=tt()>
                  否
    </form>
    </body>
    </html>