页面A中有一个文本框A 一个Click按钮 和一个iframe  iframe中有个页面B 页面B中有个  文本框B 怎么把  文本框中的A 接受的值 通过一个Click的按钮传到 文本框B 中去

解决方案 »

  1.   

    JS 通过iframe访问文本框了.
      

  2.   

    aa.html
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script type="text/javascript">
    window.onload = function(){
    var bhtml = document.getElementById('bhtml').contentWindow;
    document.getElementById('click').onclick = function(){
    var text = document.getElementById('avalue').value;
    bhtml.location.href = "bb.html#" + text;
    };
    };
    </script>
    </head><body>
    <iframe id="bhtml" width="400" height="400"></iframe>
    <input type="text" id="avalue" />
    <input type="button" id="click" value="click me" />
    </body>
    </html>bb.html<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script type="text/javascript">
    window.onload = function(){
    var avalue = location.hash.substring(1);
    document.getElementById('bvalue').value = avalue;
    };
    </script>
    </head><body>
    <input type="text" id="bvalue" />
    </body>
    </html>
      

  3.   


    document.getElementById("btnId").onclick= function() {
    window.frames["iframeId"].document.getElementById("textB").value =   document.getElementById("textA").value;
    }