HTMLTableElement.caption

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

Syntax

var string = tableElement.caption;

Example

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

Specifications

Browser compatibility

BCD tables only load in the browser

See also