caption
Summary
Gets or sets the caption element of a table.
Property of dom/HTMLTableElementdom/HTMLTableElement
Syntax
var captionElement = table.caption;
table.caption = newCaption;
Return Value
Returns an object of type DOM NodeDOM Node
The caption element, or null.
Examples
This example sets the inline style for the caption property.
document.getElementById("mytable").caption.style.color = "blue";
Notes
If a table contains multiple captions, this property returns the first one.
Related specifications
- DOM Level 1
- Recommendation
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]