var ra=document.getElementById('按钮名称').value;

解决方案 »

  1.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>test</title>
    <script type="text/javascript">
    function a() {  if (f.test[0].checked == true) {
        document.getElementById("c1").style.display="none";
        document.getElementById("c2").style.display="block";
        document.getElementById("c3").style.display="none";
      }
      if (f.test[1].checked == true) {
        document.getElementById("c1").style.display="none";
        document.getElementById("c2").style.display="none";
        document.getElementById("c3").style.display="block";
      }}
    </script>
    </head>
    <body>
    <form name="f">
    <input type="radio" name="test" onclick="a()" />
    显示A
    <input type="radio" name="test" onclick="a()" />显示B
    </form>
    <table width="200" border="1" id="c1">
    <tr>
    <td colspan="3" align="center">默认表格</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    </table>
    <table width="200" border="1" id="c2" style="display:none">
    <tr>
    <td colspan="3" align="center">表格A</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    </table>
    <table width="200" border="1" id="c3" style="display:none">
    <tr>
    <td colspan="3" align="center">表格B</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    </table>
    </body>
    </html>
      

  2.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>00</title>
    <script>
    </script>
    </head><body><INPUT TYPE="radio" id="btn" value="123" onclick="alert(this.value)">123</body>
    </html>
      

  3.   


    调用了这个alert(this.value)值在怎么调用啊
      

  4.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>00</title>
    <script>
    /*在这调用*****************/
    function Nowcheck(obj){
    alert(obj.value);}
    </script>
    </head>
    <body>
    <INPUT TYPE="radio" id="btn" value="123" onclick="Nowcheck(this)"><label for=123>123</label>
    </body>
    </html>
      

  5.   

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>无标题页</title>
        <script>
        function show()
        {
            obj = event.srcElement;
            alert(obj.value);
        }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <input id="Radio1" type="radio" value="呵呵" name="r" onclick="show()"/>
            <input id="Radio2" type="radio" value="哈哈" name="r" onclick="show()"/>
            </div>
        </form>
    </body>
    </html>