Struct silkenweb_html::elements::OptionBuilder
source · pub struct OptionBuilder(_);
Implementations§
source§impl OptionBuilder
impl OptionBuilder
pub fn id(self, value: impl AttributeValue<String>) -> Self
pub fn class(self, value: impl AttributeValue<String>) -> Self
sourcepub fn disabled(self, value: impl AttributeValue<bool>) -> Self
pub fn disabled(self, value: impl AttributeValue<bool>) -> Self
If set, this option is not checkable. Often browsers grey out such control and it won’t
receive any browsing event, like mouse clicks or focus-related ones. If this attribute
is not set, the element can still be disabled if one of its ancestors is a disabled
<optgroup>
element.
sourcepub fn label(self, value: impl AttributeValue<String>) -> Self
pub fn label(self, value: impl AttributeValue<String>) -> Self
This attribute is text for the label indicating the meaning of the option. If the label attribute isn’t defined, its value is that of the element text content.
sourcepub fn selected(self, value: impl AttributeValue<bool>) -> Self
pub fn selected(self, value: impl AttributeValue<bool>) -> Self
If present, indicates that the option is initially selected. If the <option>
element
is the descendant of a <select>
element whose multiple attribute is not set, only one
single <option>
of this <select>
element may have the selected attribute.
sourcepub fn value(self, value: impl AttributeValue<String>) -> Self
pub fn value(self, value: impl AttributeValue<String>) -> Self
The content of this attribute represents the value to be submitted with the form, should this option be selected. If this attribute is omitted, the value is taken from the text content of the option element.