HTML <input> placeholder Attribute
Example
<input type="text" id="fname" name="fname" placeholder="First Name">
Meaning
The placeholder attribute specifies a short bit of text that is used to help the user figure out what type of information to fill in for a form control.
The text will be placed in the field and cleared on entering.
Standard Syntax
HTML: <input placeholder="text">
XHTML: <input placeholder="text"/>
Browser Support
Note:
- Internet Explorer 10 and 11 do not show the placeholder when the field is focused, even if the field is empty.
- Internet Explorer 10 and 11 fire the input event when an input field with a placeholder is focused or on page load when the placeholder contains certain characters
Status
Advertisement
Attribute Values
| Value | Description |
|---|---|
| text | Specifies a text that specify the expected value of the input field be. |