Back to Content

HTMLLabelElement: form property

files/en-us/web/api/htmllabelelement/form/index.md

latest1.4 KB
Original Source

{{APIRef("HTML DOM")}}

The form read-only property of the {{domxref("HTMLLabelElement")}} interface returns an {{domxref("HTMLFormElement")}} object that owns the {{domxref("HTMLLabelElement.control", "control")}} associated with this {{HTMLElement("label")}}, or null if this label is not associated with a labelable form-associated element ({{htmlelement("button")}}, {{htmlelement("input")}}, {{htmlelement("output")}}, {{htmlelement("select")}}, {{htmlelement("textarea")}}, or form-associated custom elements) that is owned by a form.

Unlike form-associated elements, the <label> element does not have a form attribute. This property does not reflect any HTML attribute, but is just a shortcut for label.control.form.

Value

An {{domxref("HTMLFormElement")}} or null.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("HTMLLabelElement")}}
  • {{domxref("HTMLInputElement.form")}}
  • {{domxref("HTMLFormElement")}}
  • {{HTMLElement("label")}}
  • HTML forms guide