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

added by JavaScript Kicks
8/1/2018 12:40:28 PM

744 Views

Ben Nadel demonstrates how to use the Element.matches() method in JavaScript to see if a given element has a CSS pseudo-class being applied to it. This covers pseudo-classes like ":hover" and ":active" as well as things like, ":-webkit-autofill".


0 comments