HTMLTableElement: caption property

The HTMLTableElement.caption property represents the table caption. If no caption element is associated with the table, this property is null.

Value

A string.

Examples

js
if (table.caption) {
  // Do something with the caption
}

Specifications

Specification
HTML Standard
# dom-table-caption-dev

Browser compatibility

desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
caption

See also