Legend formProperty
Example
Return the id of the form containing the <legend> element:
var x = document.getElementById("myLegend").form.id;
xThe output result is:
myForm
Try it yourself »
Definition and Usage
The form property returns a reference to the form containing the legend.
If successful, this property returns a form object.
Note:This property is read-only.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the form property.
Syntax
legendObject.form
Technical Details
| Return value: | A reference to the form containing the legend. Returns null if the legend is not in a form. |
|---|
Other Extensions
Label Object