Community

Checking To See If An Element Has A CSS Pseudo-Class In JavaScript

(Ben Nadel) This morning, I sat down to see if I could detect “autofill” behaviors in the browser. In doing so, I came across several StackOverflow posts that mentioned a “:-webkit-autofill” pseudo-class getting applied to inputs in WebKit-based browsers.