HTML placeholder attribute
placeholder attribute hints the user about data entry in the input field or textarea. Data entry means what kind of data should be entered in the input field.
Attribute valuesAll possible values of placeholder attribute
The value of this attribute is simple plain text.
Related TagsThe tags that support placeholder attribute
input tag allows the user to enter data. It supports placeholder attribute.
<p>Password: <input type="password" name="pass" placeholder="at least 8 digit"></p>Try</>
If the hint is longer than the width of input element, then small element should be used as side comment to hint the user. placeholder is not suitable for the older people and users with vision impairments.
Was this article helpful?