top.frames["ifr"].document.all.ta1.style

解决方案 »

  1.   

    <html>
    <head>
    <script>
    function myFun()
    { var ifr = document.getElementById("ifr");
    var table = window.ifr.document.getElementById("table1");
    if ( table.style.display == "" )
    {
    table.style.display = "none";
    }
    else
    {
    table.style.display = "";
    }

    }
    </script>
    </head>
    <body><input type="button" value="试验" onclick="myFun();">
    <div>
    <iframe id='ifr' src='test.htm'>
    </div>
    </body>
    </html>
    //////////////////////////////
    test.htm
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head><body>
    <table id="table1" border='1'>
    <tr>
    <td>dfdfdf</td>
    </tr>
    </table>
    </body>
    </html>
    我做了一个简单的例子,希望对你有帮助
      

  2.   

    <a href="http://community.csdn.net/Expert/topic/5321/5321996.xml?temp=.5491754">http://community.csdn.net/Expert/topic/5321/5321996.xml?temp=.5491754</a>