编辑下面的代码:【加编码】
<html> <head> <script> function displayResult() { alert(document.getElementById('myTable').summary); } </script> </head> <body> <table id="myTable" border="1" summary="Example table of employees"> <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()">Show table summary</button> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂