Back to Content

HTMLTableElement: caption property

files/en-us/web/api/htmltableelement/caption/index.md

latest445 B
Original Source

{{APIRef("HTML DOM")}}

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

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • The interface implementing this property: {{domxref("HTMLTableElement")}}.