:placeholder-shownBaseline · Widely available
The :placeholder-shown CSS pseudo-element selects <input> and <textarea> elements when no value is set and the element's placeholder attribute is not empty. Not to be confused with ::placeholder, which selects the placeholder text itself.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jan 15, 2020. Widely available since Jul 15, 2022.
Browser support
DesktopChrome
1–46Not supported
47+Supportedsince Dec 1, 2015
Current: 155Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154Firefox
1–50Not supported
51+Supportedsince Jan 24, 2017
Current: 157Safari
1–8Not supported
9+Supportedsince Sep 30, 2015
Current: 27MobileChrome Android
18–46Not supported
47+Supportedsince Dec 2, 2015
Current: 155Firefox Android
4–50Not supported
51+Supportedsince Jan 24, 2017
Current: 157Safari iOS
1–8Not supported
9+Supportedsince Sep 16, 2015
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: :placeholder-shown.
Feature detection
CSS · check before using
@supports selector(:placeholder-shown) {
/* styles that use :placeholder-shown */
}
/* or in JavaScript */
if (CSS.supports("selector(:placeholder-shown)")) {
// use it
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| placeholder-shown | 47 | 79 | 51 | 9 | 47 | 51 | 9 |
| placeholder-shown.non_text_types | 47 | 79 | 59 | 9 | 47 | 59 | 9 |