Name
Label — a <label> for a form control
Inherits from
Node, Element
Synopsis
A Label object represents a <label> element in an HTML
form.
Properties
readonly ElementcontrolThe FormControl that this Label is associated with. If
htmlForis specified, this property is the control specified by that property. Otherwise, this property is the first FormControl child of the<label>.readonly FormformThis property is a reference to the Form element that contains this label. Or, if the HTML
formattribute is set, the Form element identified by that ID.stringhtmlForThis property mirrors the HTML
forattribute. Sinceforis a reserved word in JavaScript, the name of this property is prefixed with “html” to create a legal identifier. If set, this property should specify the ID of the FormControl that this label is associated with. (It is usually simpler, however, to simply make that FormControl be a descendant of this Label.)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access