x
 
<!DOCTYPE html>
<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">汽车品牌</th>
    <th abbr="Model">汽车型号</th>
  </tr>
  <tr>
    <td>Porsche</td>
    <td>911</td>
  </tr>
</table>
<br>
<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>