The Caption object represents an HTML <caption> element.
You can access a <caption> element by using getElementById():
You can create a <caption> element by using the document.createElement() method:
チップ: You can also create a <caption> element by using the createCaption method of the Table object.
Property | 説明 |
---|---|
align | Not supported in HTML5. Use
style.textAlign or
style.captionSide instead. Sets or returns the alignment of the caption |
The Caption object also supports the standard properties and events.
HTML tutorial: HTML Tables
HTML reference: HTML <caption> tag
JavaScript reference: HTML DOM Table Object