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