tryjsref_th_get 在线代码实例
<h3>访问 TH 元素</h3>
<table>
<tbody><tr>
<th id="myTh">Name</th>
</tr>
<tr>
<td>John</td>
</tr>
</tbody></table>
<p>点击按钮改变 TH 元素的文本。</p>
<button onclick="myFunction()">尝试一下</button>
<p id="demo"></p>
<script>
function myFunction()
{
var x = document.getElementById("myTh");
x.innerHTML = "新的表头";
}
</script>