Hover code not working!


#1

I have no idea why this isn't working. It keeps on saying "It does't look like your background color changed, is your hover adding the class active?", even when it does work when I test it. Here's the code:
$(document).ready(function(){
$('div').hover(
function(){
$(this).addClass('active');
},
function(){
$(this).removeClass('active');
}
);
});

EDIT: Oh wow, I needed to keep hovering it for a few seconds. (...)


#3

It's not working for me either. Not even if I hover for a few seconds.
Any useful answers around here?

Thanks


#4

@dataninja49941 If you create a new topic with your code, a link to the exercise you're on, and the error message you're getting, someone will help you find the problem over there :)


#5

That code is correct. It didn't work for me in the beginning either. I found that after you hit submit if you hover over 1 box for 5 secs until it says at the bottom of the page to move out of the box and then you move your mouse away, it will pass you.