x
 
<!DOCTYPE html>
<html>
<body>
<h1>Element 对象</h1>
<h2>textContent 属性</h2>
<button id="myBtn">试一试</button>
<p>按钮的文字内容是:</p>
<p id="demo"></p>
<script>
let text = document.getElementById("myBtn").textContent;
document.getElementById("demo").innerHTML = text;  
</script>
</body>
</html>