pub struct LabelBuilder(/* private fields */);
Implementations§
Source§impl LabelBuilder
impl LabelBuilder
pub fn id(self, value: impl AttributeValue<String>) -> Self
pub fn class(self, value: impl AttributeValue<String>) -> Self
Sourcepub fn for_(self, value: impl AttributeValue<String>) -> Self
pub fn for_(self, value: impl AttributeValue<String>) -> Self
The id of a labelable form-related element in the same document as the <label>
element. The first element in the document with an id matching the value of the for
attribute is the labeled control for this label element, if it is a labelable element.
If it is not labelable then the for attribute has no effect. If there are other elements
which also match the id value, later in the document, they are not considered.
Note: A <label>
element can have both a for attribute and a contained control element,
as long as the for attribute points to the contained control element.
Sourcepub fn form(self, value: impl AttributeValue<String>) -> Self
pub fn form(self, value: impl AttributeValue<String>) -> Self
The <form>
element with which the label is associated (its form owner). If specified,
the value of the attribute is the id of a <form>
element in the same document. This
lets you place label elements anywhere within a document, not just as descendants of
their form elements.