Reputation: 495
I tried the code:
$('a').hasClass('button-hello').hover(function() { alert('ffs'); });
I have tried this, without success. I am trying to trigger hover on any A link that has button-hello in the class.
Upvotes: 0
Views: 440
Reputation: 54618
The following code:
$('a.button-hello').hover(function() { alert('ffs'); });
Will work on the following elements:
<a href="#" class="button-hello">A1</a>
<a href="#" class="button-hello a">A2</a>
<a href="#" class="button-hello a b">A3</a>
<a href="#" class="button-hello a b c">A4</a>
Upvotes: 3