<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<p>单击按钮返回 thead 元素的 innerHTML。</p>
<table id="myTable">
<thead>
<tr>
<th>月份</th>
<th>存款</th>
</tr>
</thead>
<tfoot>
<tr>
<td>合计</td>
<td>$180</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>一月</td>
<td>$100</td>
</tr>
<tr>
<td>二月</td>
<td>$80</td>
</tr>
</tbody>
</table>
<br>
<button onclick="myFunction()">试一试</button>
<script>
function myFunction() {
alert(document.getElementById("myTable").tHead.innerHTML);
}
</script>
</body>
</html>