Reputation: 67
The goal is to add the two classes to any divs with the class .title
.
Here is my code:
$(document).ready(function() {
$('#welcome').mouseenter(function() {
$('.title').addClass('animated').addClass('swing');
});
});
Is this the best way to do this?
Upvotes: 1
Views: 3214
Reputation: 2878
You have an error:
$document.ready(function() { }
should be:
$(document).ready(function() { }
If you look in your browser's developer tools, you'll see syntax errors like this in the Console tab.
Here's a working version.
Upvotes: 0
Reputation: 459
Add two classes at the same time separated by space
$('.title').addClass('animated swing')
Upvotes: 2