代码示例:(标识:jsck_doc_body_innerhtml)
<!DOCTYPE html>
<html>
<body>

<h1>Document 对象</h1>

<h2>body 属性</h2>

<p>显示该文档的 HTML 内容:</p>

<p id="demo"></p>

<script>
const myBody = document.body.innerHTML;
document.getElementById("demo").innerHTML = myBody;
</script>

</body>
</html>
运行结果: