HasSize
API reference › HTML › Form › Mixin › HasSize
Used by 7 types
Provides an immutable API for the size attribute.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/size.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
size() | Sets the size attribute. | HasSize |
Method details
Section titled “Method details”size()
Section titled “size() ”public function size(int|string|Stringable|UnitEnum|null $value): staticSets the size attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | int|Stringable|UnitEnum| | Size value. Must be ’>= 0’, or null to remove the attribute. |
Returns
static: New instance with the updated size attribute.
Throws
InvalidArgumentException: if the value is not an integer-like value ’>= 0’.