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

BCD tables only load in the browser

See also