简单教程
提交运行
代码编辑器:
<script> function displayResult(){ alert(document.getElementById('myTable').summary); } </script> <table id="myTable" border="1" summary="例如表中的员工"> <tr> <th>Firstname</th> <th>Lastname</th> </tr> <tr> <td>Peter</td> <td>Griffin</td> </tr> <tr> <td>John</td> <td>Doe</td> </tr> </table> <br> <button type="button" onclick="displayResult()">显示表格描述</button>
运行结果: