placeholder
Summary
The placeholder attribute specifies a short hint that describes the expected value of an input field (e.g. a sample value or a short description of the expected format).
Applies to | [HTMLInputElement](/html/elements/input) |
---|
Examples
Address: <input type="text" name="address" placeholder="Insert here your address" />
Date of birth: <input type="text" name="day" placeholder="DD" />
<input type="text" name="month" placeholder="MM" />
<input type="text" name="year" placeholder="YYYY" />
Notes
Remarks
The placeholder attribute can be used on text or text area input controls, or with text-based input attributes URL or email. The following example shows the placeholder text on a URL input field.
Syntax
Standards information
- HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.10.7.3.12
See also
Related pages
- HTMLInputElementHTMLInputElement
- HTMLTextAreaElementHTMLTextAreaElement
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]