首页 > JavaScript 怎么看解析后的源代码?

JavaScript 怎么看解析后的源代码?

比如我写了个脚本:

<script>
var a='<div style="background-color:red;height:100px;width:100px"></div>';
document.write(a);
</script>

要是在网页看源代码的话,也是:

<script>
var a='<div style="background-color:red;height:100px;width:100px"></div>';
document.write(a);
</script>

怎么才能看到:

<div style="background-color:red;height:100px;width:100px"></div>

就是JavaScript运算完后的html代码?


网页上右键“审元素”(chrome)/"查看元素"(firefox)


浏览器 查看dom


把内容写入到一个div中试试。

【热门文章】
【热门文章】