HTML Attributes

HTML placeholder attribute

Build a form with the HTML form generator

Shows a temporary hint when a supported form field is empty. It disappears during entry and is not a substitute for a persistent accessible label. Applicable elements include: <input>, <textarea>. Check each element’s value rules. A placeholder is a hint, not the submitted value, and normally disappears as the control gains text. It is not a substitute for an associated visible label. Use the value attribute or DOM value property for an actual default value.

Formal Syntax & Structure

html syntaxhtml
placeholder="you@example.com"

Parameters & Attributes

NameTypeDescription
placeholdershort text hintShows a temporary hint when a supported form field is empty. It disappears during entry and is not a substitute for a persistent accessible label.

Working Example

Example Snippethtml
<label>  Email  <input type="email" placeholder="you@example.com"></label>

Browser Compatibility

Minimum supported versions across modern rendering engines

Blink (modern)
Chrome
3
Yes
EdgeHTML / Blink
Edge
12
Yes
Gecko
Firefox
4
Yes
WebKit
Safari
4
Yes
Presto / Blink
Opera
≤12.1
Yes
Desktop support for placeholder on input only; other elements, input types, individual values and mobile behavior may differ.
HTML Living Standard
HTML Reference