alert(document.body.innerHTML)
如果太长就
a=window.open('')
a.document.write(document.body.innerHTML)

解决方案 »

  1.   

    javascript本来就试嵌在html中的在浏览器上运行的所以你的javascript代码试可见的
      

  2.   

    直接用innerHTML查看代码,
    代码如下:<body>
    <script language="JavaScript">
    function inserttable()
    {
    var t = document.createElement("<table border=1>");
    var r = t.insertRow();
    var d = r.insertCell();
    d.innerText = 'hello,world';
    document.getElementById('showid').insertAdjacentElement('beforeEnd', t);
    }
    </script><button onclick="inserttable()">动态插入一个表格</button>
    <button onclick="alert(document.all.showid.innerHTML)">取代码</button>
    <div id=showid style="height:200;width:200;border:1 solid red"></div>
    </body>
      

  3.   

    scoutlin(梅川库子)男优也有理想  seeu1688(kangel) 说的ok,给分!