HTMLLabelElement
The HTMLLabelElement interface gives access to properties specific to <label> elements. It inherits methods and properties from the base HTMLElement interface.
Properties
Inherits properties from its parent, HTMLElement.
HTMLLabelElement.controlRead only-
Is a
HTMLElementrepresenting the control with which the label is associated. HTMLLabelElement.formRead only-
Is a
HTMLFormElementobject representing the form with which the labeled control is associated, ornullif there is no associated control, or if that control isn't associated with a form. In other words, this is just a shortcut forHTMLLabelElement.control.form. HTMLLabelElement.htmlFor-
Is a string containing the ID of the labeled control. This reflects the
forattribute.
Note: To programmatically set the for attribute, use htmlFor.
Methods
No specific methods; inherits methods from its parent, HTMLElement.
Specifications
| Specification |
|---|
| HTML Standard # htmllabelelement |
Browser compatibility
BCD tables only load in the browser
See also
- The HTML element implementing this interface:
<label> <form>HTMLFormElement