HasFor
API reference › HTML Attribute › HasFor
Used by 1 type
Provides an immutable API for the for attribute.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/for.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
for() | Sets the for attribute. | HasFor |
Method details
Section titled “Method details”for()
Section titled “for() ”public function for(string|Stringable|UnitEnum|null $value): staticSets the for attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Space-separated list of related IDs, or null to remove the attribute. |
Returns
static: New instance with the updated for attribute.