<table id="t1" width="200" border="1"><tr><td>Test</td></tr></table>
<input type="button" value=" Test " onClick="t1.style.display=t1.style.display==''?'none':''">

解决方案 »

  1.   

    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %><!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 runat="server">
        <title>无标题页</title>
        <script language="javascript" type="text/javascript">
        Function aaa(){
                if(document.form1.ValueTable.style.display == 'none')
                {document.form1.ValueTable.style.display='';}
                else
                {document.form1.ValueTable.style.display='none';}
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <table id="ValueTable" style="display:block;" border="1"  >
                <tr>
                    <td style="width: 257px">
                    </td>
                    <td style="width: 430px">
                        <input id="Button2" type="button" value="button" />
                        <input id="Button3" type="button" value="button" /></td>
                    <td style="width: 161px">
                    </td>
                </tr>
            </table>
        </div>
            <input id="Button1" type="button" value="button" onclick="aaa()" />
        </form>
    </body>
    </html>
    帮忙看看!哪错了!
    实现功能,点击一次按钮!显示table,再点击一次隐藏table。
      

  2.   

    aaa()后面有个分号,Functions 要改成function
    下面这个不知道能不能帮你,
    <html  >
    <head >
        <title>无标题页</title>
        <script language="javascript">
        function aaa(){
                document.all.showupdate.style.display='none';
                document.all.show2.style.display='block';
                document.all.show3.style.display='none';
            }
    function aa(){
                document.all.showupdate.style.display='block';
                document.all.show2.style.display='none';
                 document.all.show3.style.display='block';
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <span  id="showupdate" style="display:block">
             <table  border="1"  >
                <tr>
                    <td style="width: 257px">
                    </td>
                    <td style="width: 430px">
                        <input id="Button2" type="button" value="一" />
                        <input id="Button3" type="button" value="二" /></td>
                    <td style="width: 161px">
                    </td>
                </tr>
            </table>
            </span>
        </div>
             <span  id="show3" style="display:block">
            <input id="Button1" type="button" value="按钮1" onclick="aaa();"/>
             </span>
            <span  id="show2" style="display:none">
           <input id="Button1" type="button" value="按钮2" onclick="aa();"/>
           </span>
        </form>
    </body>
    </html>
      

  3.   

    楼主fuction写错了,而且取form里面元素方法不对,下面的可以用
    <!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 runat="server">
        <title>无标题页</title>
        <script language="javascript" type="text/javascript">
        function aaa(){
                if(document.getElementById("ValueTable").style.display == 'none')
                {document.getElementById("ValueTable").style.display='';}
                else
                {document.getElementById("ValueTable").style.display='none';}
            }
        </script>
    </head>
    <body>
        <form name="form1" runat="server">
        <div>
            <table id="ValueTable" style="display:block;" border="1"  >
                <tr>
                    <td style="width: 257px">
                    </td>
                    <td style="width: 430px">
                        <input id="Button2" type="button" value="button" />
                        <input id="Button3" type="button" value="button" /></td>
                    <td style="width: 161px">
                    </td>
                </tr>
            </table>
        </div>
            <input id="Button1" type="button" value="button" onclick="aaa()" />
        </form>
    </body>
    </html>
      

  4.   

    <script language="javascript" type="text/javascript">
    function aaa(){
    var obj=document.getElementById("ValueTable");
    if(obj.style.display == 'none')
    {obj.style.display='';}
    else
    {obj.style.display='none';}
    }
    </script>