4/12 Combining .click() and .hover() HELP don't know what is wrong


#1

$(document).ready(function() {
    $('div').click(function() {
        $(this).fadeOut('fast');
    $('div').hover(function() {
      $(this).addClass('red');  
    });
    });
});

This code is not working


#2

Your hover function is inside the click function. There will be hover effect only when you click on the div element.
Close the click function with }); before the hover function.


#3

Thank you so much it worked!! :smiley: