HTML DOM Caption 對象
Caption 對象
Caption 對象代表 HTML <caption> 元素。
訪問 Caption 對象
您可使用 getElementById() 來訪問 <caption> 元素:
var x = document.getElementById("myCaption");
創建 Caption 對象
您可使用 document.createElement() 方法來創建 <caption> 元素:
var x = document.createElement("CAPTION");
提示:您還可以使用 Table 對象的 createCaption 方法創建 <caption> 元素。
Caption 對象屬性
屬性 | 描述 |
---|---|
align |
HTML5 不支持。請改用 style.textAlign 或 style.captionSide。 設置或返回標題的對齊方式。 |