x
 
<!DOCTYPE html>
<html>
<body>
<h1>Element 对象</h1>
<h2>innerText 属性</h2>
<button id="myBtn">试一试</button>
<p>button 元素的文本内容是:</p>
<p id="demo"></p>
<p>Internet Explorer 9 及更早版本不支持 innerText 属性。</p>
<script>
let text = document.getElementById("myBtn").innerText;
document.getElementById("demo").innerHTML = text;  
</script>
</body>
</html>