HasPlaceholder
API reference › HTML › Form › Mixin › HasPlaceholder
Used by 7 types
Provides an immutable API for the placeholder attribute.
Satisfies PlaceholderInterface for the controls that declare it.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/placeholder.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
placeholder() | Sets the placeholder attribute. | HasPlaceholder |
Method details
Section titled “Method details”placeholder()
Section titled “placeholder() ”public function placeholder(string|Stringable|UnitEnum|null $value): staticSets the placeholder attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Placeholder text, or null to remove the attribute. |
Returns
static: New instance with the updated placeholder attribute.