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

<h1>Element 对象</h1>

<h2>innerHTML 属性</h2>

<button onclick="myFunction()">试一试</button>

<p id="demo">单击按钮将此文本加倍。</p>

<script>
function myFunction() {
  const element = document.getElementById("demo");
  element.innerHTML += element.innerHTML;
}
</script>

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