Latest web development tutorials

HTML DOM Legend form 屬性

Label 對象參考手冊 Label對象

實例

返回包含<legend> 元素的表單的id:

var x = document.getElementById("myLegend").form.id;

x輸出結果為:

myForm

嘗試一下»

定義和用法

form 屬性返回一個包含legend 的表單的引用。

如果成功,該屬性返回一個表單對象。

注意:該屬性是只讀的。


瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主流瀏覽器都支持form 屬性。


語法

legendObject .form

技術細節

返回值: 一個包含legend 的表單的引用。 如果legend 不在表單內,則返回null。


Label 對象參考手冊 Label對象