Table deleteCaption() 方法
描述
deleteCaption() 方法會移除表格中的第一個 <caption> 元素(及其內容)。
提示: 要為表格建立新的 <caption> 元素,請使用 createCaption() 方法。
瀏覽器支援
方法 | |||||
---|---|---|---|---|---|
deleteCaption() | 是 | 是 | 是 | 是 | 是 |
語法
tableObject.deleteCaption()
引數
無 |
技術詳情
返回值 | 無返回值 |
---|
更多示例
示例
建立和刪除 <caption> 元素
function myCreateFunction() {
var table = document.getElementById("myTable").createCaption();
table.innerHTML = "<b>My table caption</b>";
}
function myDeleteFunction() {
document.getElementById("myTable").deleteCaption();
}
自己動手試一試 »
相關頁面
HTML 參考: HTML <caption> 標籤
↜ Table 物件