Firefox Tomorrow

web api interface

HTMLLabelElement

View on MDN ↗

The HTMLLabelElement interface gives access to properties specific to <label> elements. It inherits methods and properties from the base HTMLElement interface.

Instance properties

Inherits properties from its parent, HTMLElement.

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

[!NOTE] To programmatically set the for attribute, use htmlFor.

Instance methods

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

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also