HTML DOM Table deleteCaption() 方法

定义和用法

deleteCaption() 方法用于删除表格的 caption 元素及其内容。

提示: 在表格中创建新的标题请使用 createCaption() 方法。

语法

tableObject.createTFoot()

实例

下面的例子删除表格的标题:

<html>
<head>
<script>
function displayResult()
{
document.getElementById("myTable").deleteCaption();
}
</script>
</head>
<body>

<table id="myTable" border="1">
<caption>This is a table caption</caption>
  <tr>
    <td>cell 1</td>
    <td>cell 2</td>
  </tr>
  <tr>
    <td>cell 3</td>
    <td>cell 4</td>
  </tr>
</table>
<br>
<button type="button" onclick="displayResult()">Delete caption</button>

</body>
</html>
系统帮助 | 给我留言 | 收藏本站
Copyright © 2005-2008 www.cnn84.com All Rights Reserved Ver:2.0 桂公网安备45122402000102号
CNN84网是公益性便民网站,是为了给大家的日常生活查询及提供最快捷的出行指南