The placeholder attribute shows brief hint text in a form control when it has no value. Use a short example of the expected data (for example e.g. [email protected]), not a full prompt or label.
Not deprecated and not experimental. Widely supported across modern browsers for the input types listed above and for textarea.
Accessibility warning.
Per MDN: never use placeholder instead of a <label>. Placeholder text has lower contrast, disappears while typing, and is not announced like a label by default.
Syntax
HTML Syntax
syntax.html
<input|textarea placeholder="text">
text is the hint shown while the control is empty. Equivalent JS: el.placeholder = "hint".
Values
Attribute Values
The value is plain text (a short hint). Common patterns:
Placeholder is gray hint text — not the control’s value.
Value is actual content the user (or page) put in the field.
On submit, empty + placeholder sends nothing for that name; value="Paris" sends Paris.
Do not use value to fake a placeholder — users must delete it.
Edge Cases & Pitfalls
Most accessibility bugs are missing labels or putting the only instructions in the placeholder.
a11y
Not a label replacement
Screen readers announce labels; placeholders are often skipped. Keep a real <label>.
contrast
Lower contrast by design
Placeholder text is intentionally lighter than real input text. Do not rely on it for critical instructions.
types
Limited input types
Per MDN: text, search, url, tel, email, password (+ textarea). Not for select, checkbox, or radio.
newline
No line breaks in input
LF/CR in an <input> placeholder clip the text. Use one short line.
submit
Not form data
Placeholder is never submitted. Only value (typed or set) is.
Compatibility
Browser Support
placeholder is an HTML attribute for text-like inputs and textarea in the browser. It is not a Node.js, Deno, or Bun API.
✓ Widely available
placeholder
Supported in all modern browsers for text-like inputs and textarea. Keep using labels for accessibility regardless of support.
97%Global support (approx.)
Google ChromeAll modern
Full support
Mozilla FirefoxAll modern
Full support
Apple SafariAll modern
Full support
Microsoft EdgeAll modern
Full support
OperaAll modern
Full support
Samsung InternetModern
Full support
Internet Explorer10+
Supported
placeholderWidely supported
Bottom line: Safe to use as a short empty-state hint. Always include a visible label, and never store the only instructions in the placeholder.
Remember
Key Takeaways
Role: short example hint while the field is empty.
Always use a <label> — placeholder is not a label.
Not submitted — unlike value.
Types: text-like inputs + textarea (per MDN).
One line:placeholder is a short empty-state example — label the field, then optionally hint.
Frequently Asked Questions
It shows brief hint text inside a form control when the control has no value. The hint disappears when the user enters data. It is not submitted with the form.
Per MDN: input types text, search, url, tel, email, and password, plus textarea. It is not for select, checkbox, radio, or button.
No. MDN: never use placeholder instead of a label. Labels stay visible, associate programmatically with the control, and are announced by screen readers; placeholders are not a reliable label.
value is real form data that can be submitted. placeholder is temporary empty-state hint text and is not sent on submit.
On input, LF/CR are not allowed and clip the text. On textarea, multiline placeholder text is allowed.
No. It is a standard HTML attribute. The main caution is accessibility: use it only as a short example/hint alongside a real label.