Web features explorer

:placeholder-shown

Widely available since 2022-07-15
Tags: css Groups: CSS > Selectors

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.

Learning resources on MDN

Browser support (view on caniuse.com)