You are here: Reference > JavaScript > client-side > HTML DOM > methods > deleteCaption (table)

deleteCaption method (table)

Browser support:
Removes the first caption element from the current table.
If no caption exists on the current table, the deleteCaption method has no effect. Note: a table element may have more than one caption in Internet Explorer and Opera, and at most one caption in Firefox, Google Chrome and Safari.
To create a new caption for a table, use the createCaption method.


object.deleteCaption ( );
You can find the related objects in the Supported by objects section below.

Return value:

This method has no return value.

Example HTML code 1:

This example illustrates the use of the deleteCaption method:
    <script type="text/javascript">
        function RemoveCaption () {
            var table = document.getElementById ("myTable");
            table.deleteCaption ();
    <table id="myTable" border="1px">
            <b>Caption for the table.</b>
                <td>This text is inside the table.</td>
    <br /><br />
    <button onclick="RemoveCaption ();">Remove the caption!</button>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content