Label form Attribute
Definition and Usage
form
This property returns a reference to the form containing the label (label).
This property returns the form object on success.
Note:This property is read-only.
See also:
HTML Reference Manual:HTML <label> form Attribute
HTML Reference Manual:HTML <label> Tag
Example
Returns the id of the form containing the <label> element:
var x = document.getElementById("myLabel").form.id;
Syntax
labelObject.form
Technical Details
Return Value: |
Reference to the form element containing the label (label). Returns null if the tag is not in the form. |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |