What HTML attribute on an <input> element hints at the expected input in a text field?

The story behind the answer

The HTML attribute on an <input> element that hints at the expected input in a text field is `placeholder`.

A placeholder displays a short hint inside an otherwise empty form control, such as “[email protected]” or “Search articles.” It disappears when the user enters a value, so it describes the expected format without becoming part of the submitted data. It is supported by text-oriented input types including text, search, URL, telephone, email, and password.

The main mix-up is confusing `placeholder` with `title`, `name`, or `value`. The `name` identifies the field when form data is submitted, `value` supplies its actual value, and `title` commonly provides advisory text or a tooltip. A placeholder is only a hint and should not replace a visible, programmatically associated `<label>`, because it vanishes during entry and may not be announced reliably by screen readers.

The feature became especially prominent with HTML5 forms, which added richer input types and built-in form guidance and validation. The broader HTML standard is now maintained as a living standard by WHATWG.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: