CanBeSelected
API reference › HTML Attribute › CanBeSelected
Used by 1 type
Provides an immutable API for the selected attribute.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/option#selected.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
selected() | Sets the selected attribute. | CanBeSelected |
Method details
Section titled “Method details”selected()
Section titled “selected() ”public function selected(bool|null $value): staticSets the selected attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | bool| | Selected state. Use true to mark selected, false to unselect, or null to remove the attribute. |
Returns
static: New instance with the updated selected attribute.