ifrm1.window.document...
->  document.frames["ifrm1"].document...document.frames["ifrm1"].document.designMode = true;

解决方案 »

  1.   

    我就是用的楼上的方法,但是我鼠标在iframe框里一点,里面已经存在的内容就被清空了,我想保留那些内容进行编辑该怎么办啊?谢谢了
      

  2.   

    <html>
    <head>
    <script>
    function setv(){
    document.frames["ifrm1"].document.designMode = "On";//记错了,^_^
    document.frames["ifrm1"].document.body.innerHTML = document.frames["ifrm1"].document.getElementById("aa").innerHTML;
    }
    </script>
    </head>
    <body>
    <iframe name="ifrm1" src="3.htm" onload="setv()"></iframe>
    <button onclick="alert(document.frames['ifrm1'].document.body.innerHTML);">click me</button>
    </body>
     </html>