<BODY>
<iframe id="wQingEditor"></iframe>
</BODY>
</HTML>
<SCRIPT LANGUAGE="JavaScript">
<!--
alert(document.getElementById("wQingEditor")[0]==wQingEditor[0]);
//-->
</SCRIPT>

解决方案 »

  1.   

    还是不明白,为什么以下的结果不一样呢:
    <BODY>
    <iframe id="wQingEditor"></iframe>
    </BODY>
    </HTML><INPUT TYPE="submit" onclick="test()" value="测试">
    <INPUT TYPE="submit" onclick="test1()" value="测试1"><INPUT TYPE="submit" onclick="test2()" value="测试2">
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function test()
    {
    wQingEditor.document.body.innerHTML="tt";
    }
    function test1()
    {
    var Obj=document.getElementById("wQingEditor");
    Obj.document.body.innerHTML="No1";
    }
    function test2()
    {
    var Obj=document.getElementById("wQingEditor")[0];
    Obj.document.body.innerHTML="No1";
    }
    //-->
    </SCRIPT>
      

  2.   

    对不起,刚才搞错了.我刚才以为iframe是一个div.应该是这样
    <BODY>
    <iframe id=wQingEditor></iframe>
    </BODY>
    </HTML>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    alert(window.wQingEditor==wQingEditor);
    //-->
    </SCRIPT>
      

  3.   

    那是不是document.getElementById("wQingEditor")和直接用wQingEditor有区别?
      

  4.   

    document.getElementById("wQingEditor")是document对象
    wQingEditor是window对象