deleteCaption() 方法用于删除表格的 caption 元素及其内容。
</>code
- tableObject.deleteCaption()
如果该表有 <caption> 元素,则从文档树种删除它。否则,什么也不做。
下面的例子删除表格的标题:
</>code
- <html>
- <head>
- <script type="text/javascript">
- function deleteCaption()
- {
document.getElementById('myTable').deleteCaption()
- }
- </script>
- </head>
- <body>
- <table id="myTable" border="1">
- <caption>My table caption</caption>
- <tr>
- <th>Firstname</th>
- <th>Lastname</th>
- </tr>
- <tr>
- <td>Peter</td>
- <td>Griffin</td>
- </tr>
- </table>
- <br />
- <input type="button" onclick="deleteCaption()"
- value="Delete caption" />
- </body>
- </html>
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛
Powered by 365建站网 RSS地图 HTML地图
copyright © 2013-2024 版权所有 鄂ICP备17013400号