X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Table deleteCaption() Method

Table Object Reference Table Object

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

Internet Explorer Firefox Opera Google Chrome Safari

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 Reference Table Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook