将HTML嵌入页面

时间:2019-06-28 20:23:14

标签: javascript html iframe

我一直在研究W3School的try it编辑器(https://www.w3schools.com/html/tryit.asp?filename=tryhtml_basic),我想创建类似的东西。我希望能够将整个html文档的代码放到另一个文档中,并显示出来。

当我搜索如何执行此操作时,我只找到了将另一个页面的网址嵌入到iframe中的方法,但我不希望这样做。我想要这样的东西:

<!DOCTYPE html>
<html>
<body>
    <p>from this page</p> 


    <iframe> <!-- or some other tag -->

        <!-- not a link -->
        <!DOCTYPE html>
        <html>
            <body>
                <p>from another page</p>
            </body>
        </html>

    </iframe> <!-- or some other tag -->

    <script>

    </script>
</body>
</html>

0 个答案:

没有答案
相关问题