Reputation: 13077
I have a problem that needs me to find all elements with a :hover class. Is there a way to do this. I was expecting to be able to do `$(':hover'), but strangely that doesn't seem to work.
What I wanted to be able to do was.
$('*:hover').mouseover(myFunction).mouseout(myFunction);
Upvotes: 1
Views: 279
Reputation: 3653
This will grep by class name :hover
$.grep($('*'), function(fn) { return $(fn).hasClass(':hover') })
Upvotes: 1