Input Number placeholder Attribute
Example
Modify the placeholder text for the number field:
Definition and Usage
The placeholder attribute is used to set or return the value of the placeholder attribute for the number field.
The placeholder attribute provides a hint describing the expected value of an input field.
This hint is displayed in the input field when it is empty and disappears when the field gets focus.
Browser Support
All major browsers support the placeholder attribute.
Note: Internet Explorer 9 and earlier versions do not support the <input> element with the type="number" attribute.
Syntax
Return the placeholder attribute:
Set the placeholder attribute:
Attribute Values
| Value | Description |
|---|---|
| text | Describes the expected value hint for the number field (a word or a short phrase) |
Technical Details
| Return Value: | String, representing the expected value hint for the number field | | --- | --- |
More Examples
Example
Display the placeholder text for the number field:
Related Pages
HTML reference: HTML <input> placeholder Attribute