比如我写了个脚本:
<script>
var a='<p style="background-color:red;height:100px;width:100px"></p>';
document.write(a);
</script>
要是在网页看源代码的话,也是:
<script>
var a='<p style="background-color:red;height:100px;width:100px"></p>';
document.write(a);
</script>
怎么才能看到:
<p style="background-color:red;height:100px;width:100px"></p>
就是JavaScript运算完后的html代码?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
网页上右键“审元素”(chrome)/"查看元素"(firefox)
把内容写入到一个p中试试。
浏览器 查看dom