This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The HTMLLabelElement interface gives access to properties specific to <label> elements. It inherits methods and properties from the base HTMLElement interface.
Inherits properties from its parent, HTMLElement.
HTMLLabelElement.control Read only
A HTMLElement representing the control with which the label is associated.
HTMLLabelElement.form Read only
A HTMLFormElement object representing the form with which the labeled control is associated, or null if there is no associated control, or if that control isn't associated with a form. In other words, this is just a shortcut for HTMLLabelElement.control.form.
HTMLLabelElement.htmlForA string containing the ID of the labeled control. This reflects the for attribute.
Note: To programmatically set the for attribute, use htmlFor.
No specific methods; inherits methods from its parent, HTMLElement.
| Specification |
|---|
| HTML> # htmllabelelement> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
HTMLLabelElement |
1 | 12 | 1 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 3 | 1 |
control |
6 | 18 | 4 | ≤12.1 | 5.1 | 18 | 4 | ≤12.1 | 5 | 1.0 | 3 | 5 |
form |
1 | 12 | 1 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
htmlFor |
1 | 12 | 1 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
<label>
<form>HTMLFormElement
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement