HTMLLabelElement: form property
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The form read-only property of the HTMLLabelElement interface returns an HTMLFormElement object that owns the control associated with this <label>, or null if this label is not associated with a labelable form-associated element (<button>, <input>, <output>, <select>, <textarea>, or form-associated custom elements) that is owned by a form.
Unlike form-associated elements, the <label> element does not have a form attribute. This property does not reflect any HTML attribute, but is just a shortcut for label.control.form.
Value
An HTMLFormElement or null.
Specifications
| Specification |
|---|
| HTML> # dom-label-form-dev> |
Browser compatibility
Loading…