js怎么判断iframe的designMode状态为开或关啊?
谢谢!

解决方案 »

  1.   

    <html>
    <head>
    </head>
    <script language="javascript">
    function setDesignMode(status)
    {
    var doc = document.frames(0).document;
    if(doc.designMode=="On"){
    //开
    }else{
    //关
    }
        doc.designMode=status;
    }
    </script>
    <body>
    <input type=button onclick="setDesignMode('On')" value="开始">
    <input type=button onclick="setDesignMode('Off')" value="停止">
        <iframe id="myiframe" style="width:750px; height:400px; border:1;"></iframe>
    </body>
    </html>