Table deleteCaption() Method
Example
Remove the <caption> element from a table:
document.getElementById("myTable").deleteCaption();
Try it yourself »
Definition and Usage
The deleteCaption() method removes the first <caption> element (and its content) from the table.
Tip: To create a new <caption> element for a table, use the createCaption() method.
Browser Support
The deleteCaption() method is supported in all major browsers.
Syntax
tableObject.deleteCaption()
Parameters
None |
Technical Details
Return Value: | No return value |
---|
More Examples
Example
Create and delete a <caption> element:
function myCreateFunction() {
var table =
document.getElementById("myTable").createCaption();
table.innerHTML = "<b>My table caption</b>";
}
function
myDeleteFunction() {
document.getElementById("myTable").deleteCaption();
}
Try it yourself »
Related Pages
HTML reference: HTML <caption> tag
Table Object