Web/API/HTMLLabelElement

From Get docs


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 StandardThe definition of 'HTMLLabelElement' in that specification. Living Standard  
HTML5The 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 SpecificationThe definition of 'HTMLLabelElement' in that specification. Obsolete No change from Document Object Model (DOM) Level 1 Specification.
Document Object Model (DOM) Level 1 SpecificationThe definition of 'HTMLLabelElement' in that specification. Obsolete Initial definition.

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
HTMLLabelElement Chrome

Full support Yes

Edge

Full support 12

Firefox

Full support 1

IE

Full support Yes

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

control Chrome

Full support Yes

Edge

Full support 18

Firefox

Full support 4

IE

Full support Yes

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

form Chrome

Full support Yes

Edge

Full support 12

Firefox

Full support 1

IE

Full support Yes

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

htmlFor Chrome

Full support Yes

Edge

Full support 12

Firefox

Full support 1

IE

Full support Yes

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

Legend

Full support  
Full support


See also