<table>
<caption>
This caption will be deleted!
</caption>
<tbody>
<tr>
<td>Cell 1.1</td>
<td>Cell 1.2</td>
</tr>
<tr>
<td>Cell 2.1</td>
<td>Cell 2.2</td>
</tr>
</tbody>
</table>HTMLTableElement: deleteCaption() method / notebook
HTMLTableElement: deleteCaption() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const table = document.querySelector("table");
table.deleteCaption();