<html>
<head>
<style>
table,th,td
{
border:1px solid black;
}
</style>
</head>
<body>
<p>点击按钮返回 id 为 "myTh" 的 th 的 abbr 属性的值。</p>
<table>
<tr>
<th id="myTh" abbr="Make">Toy manufacturer</th>
<th abbr="Model">Vehicle model</th>
</tr>
<tr>
<td>Bruder Toys</td>
<td>Cross Country Vehicle</td>
</tr>
<tr>
<td>Bruder Toys</td>
<td>DHL Lorry</td>
</tr>
</table>
<p><b>注意:</b>尽可能让缩写名称简短。浏览器可能会反复呈现它们。</p>
<button onclick="myFunction()">尝试一下</button>
<p id="demo"></p>
<script>
function myFunction()
{
var x = document.getElementById("myTh").abbr;
document.getElementById("demo").innerHTML=x;
}
</script>
</body>
</html>