Not working for me.. can u help me?




I'm guessing you're on this lesson - 6. Hover

A few mistakes:

  1. Where's your document .ready at the start ?
  2. This line is broken: function(){
  3. here :arrow_down:

you need to change }; to: }); this: ) is for closing the functions bracket

You need to add mouseleave to 'div' and in the function add remove class. Like so:


*Remember in order for you to pass even if the code is correct you need to hover over the div wait a few seconds remove your mouse from the div wait a few seconds and then exit preview.

Have a look at below if you don't understand don't copy and paste

In conclusion:


//below this is so when you hover the class is added

//below this is so that when your mouse leaves the div the class gets removed

}); //closing document.ready


Thank u, if i copy your codes, i get like this.

Oops, try again.
It does't look like your background color changed, is your hover adding the class active?


As I said understand and correct your mistakes don't copy, but my code is correct unless I'm missing something,

You need to test the code correctly by waiting a few seconds after hovering and a few seconds after you move your mouse out..

Can you see the changes in the div?


ok.. copy your correct codings and send me for my verification.


Hi Vijaya :slight_smile:

The only problem your code has is that it does not have $(document).ready, as has been told by @zainabrawat earlier. With that function put in its proper place, your code woks perfectly :smiley:

Because that function wasn't there, your function was running before those divs loaded, and so was trying to attach the hover handler to divs that didn't exist at that time. Hence, you couldn't see the effect of your hover handler.

Hope it helps! :smiley:


A post was split to a new topic: 6. Hover