How to trigger CSS “hover state” using Javascript? [duplicate]

You’re probably better off duplicating the :hover styles into another class and then just adding that class name to the element when you want them to change permanently. Pseudo-classes are “pseudo” for a reason.

Leave a Comment