We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

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.control Read only
Is a HTMLElement representing the control with which the label is associated.
HTMLLabelElement.form Read only
Is 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.htmlFor
Is a string containing the ID of the labeled control. This reflects the for attribute.

Methods

No specific methods; inherits methods from its parent, HTMLElement.

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'HTMLLabelElement' in that specification.
Living Standard No change from HTML5.
HTML5
The definition of 'HTMLLabelElement' in that specification.
Recommendation The property accessKey is now defined on HTMLElement.
The following property has been added: control.
Document Object Model (DOM) Level 2 HTML Specification
The definition of 'HTMLLabelElement' in that specification.
Obsolete No change from Document Object Model (DOM) Level 1 Specification.
Document Object Model (DOM) Level 1 Specification
The definition of 'HTMLLabelElement' in that specification.
Obsolete Initial definition.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support Yes Yes1 Yes Yes Yes
control Yes Yes4 Yes Yes Yes
form Yes Yes1 Yes Yes Yes
htmlFor Yes Yes1 Yes Yes Yes
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes Yes Yes4 Yes Yes ?
control Yes Yes Yes4 Yes Yes ?
form Yes Yes Yes4 Yes Yes ?
htmlFor Yes Yes Yes4 Yes Yes ?

See also

Document Tags and Contributors

Last updated by: fscholz,