HasId
API reference › HTML Attribute › Global › HasId
Used by 4 types
Provides an immutable API for the id attribute.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
id() | Sets the id attribute. | HasId |
Method details
Section titled “Method details”public function id(string|Stringable|UnitEnum|null $value): staticSets the id attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Element identifier, or null to remove the attribute. |
Returns
static: New instance with the updated id attribute.