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

<h1>设置 HTML</h1>

<div id="01">
  <h2>Hello China!</h2>
</div>
<div id="02">
  <h2>Hello World!</h2>
</div>

<script>
var content = document.getElementById("01").innerHTML;
document.getElementById("02").innerHTML = content;
</script>

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