Rene Zammit
Rene Zammit

Reputation: 1151

passing on to classes in mouseover function

I would like to activate the mouseover when there one of the two classes present. Right now I have one class named first-game.

 $(document).on('mouseover', 'a.first-game', function(e){

Now I want two classes. I tried something like this:

 $(document).on('mouseover', 'a.first-game' || 'a.second-game', function(e){

Any help would be much appreciated

Upvotes: 0

Views: 45

Answers (1)

Arun P Johny
Arun P Johny

Reputation: 388316

You need to use multiple selector where each selector is separated by ,

$(document).on('mouseover', 'a.first-game, a.second-game', function(e){

Demo: Fiddle

Upvotes: 1

Related Questions