pure javascript to check if something has hover (without setting on mouseover/out)

Simply using element.matches(':hover') seems to work well for me, you can use a comprehensive polyfill for older browsers too: https://developer.mozilla.org/en-US/docs/Web/API/Element/matches

Leave a Comment