Class Label
The label element represents a caption for a form control. It provides a programmatic association between the label and the form control, improving accessibility and user experience. When a label is associated with a form control, clicking the label will focus or activate the control.
Examples:
See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.juneau.bean.html5.HtmlElementMixed
child, children, getChild, getChild, getChild, getChildren, setChildrenMethods inherited from class org.apache.juneau.bean.html5.HtmlElement
accesskey, attr, attrUri, class_, contenteditable, deminimize, dir, getAttr, getAttr, getAttrs, hidden, id, lang, onabort, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, oncuechange, ondblclick, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting, self, setAttrs, spellcheck, style, tabindex, title, toString, translate
-
Constructor Details
-
Method Details
-
for_
for attribute.Associates the label with a form control by specifying the control's ID. This creates a programmatic relationship between the label and the form control for accessibility.
The value should match the ID of a form control element in the same document.
- Parameters:
value- The ID of the form control to associate with this label. Can benull to unset the attribute.- Returns:
- This object.
-
form
form attribute.Associates the label with a form element by specifying the form's ID. This allows the label to be placed outside the form element while still being part of the form.
The value should match the ID of a form element in the same document.
- Parameters:
value- The ID of the form element to associate with this label. Can benull to unset the attribute.- Returns:
- This object.
-