Reblogged by kornel ("Kornel"):
bramus@front-end.social ("Bramus") wrote:
Feels good to update an article from early 2021 to say that the problem described back then is nowadays solved by a single CSS pseudo selector.
Selector in case: `:user-invalid`. It represents any validated form element whose value isn’t valid based on their validation constraints, **after the user has interacted with it.**
Supported by Firefox 88 and Safari 16.5 before, and now also by Chrome 119 (current Chrome Dev, to hit stable in October)