x
 
<!DOCTYPE html>
<html>
<body>
<h1>Element 对象</h1>
<h2>innerHTML 属性</h2>
<p id="myP">我是段落。</p>
<p>“myP”的内容是:</p>
<p id="demo"></p>
<script>
let html = document.getElementById("myP").innerHTML;
document.getElementById("demo").innerHTML = html;
</script>
</body>
</html>