Why am I getting an error when the code is working as expected?


#1

The instructions are: Use a compound selector to apply a fadeTo() to both the .pink and .red selectors.

So I wrote this which works:

$(document).ready(function() {
$('div').click(function() {
$('.red, .pink').fadeTo('slow', 0);
});
});

But I still get this error: Did you call fadeTo('slow',0) on the .pink divs?
Why is this happening?


#2

In this task(8/13), you don't need to add the 'click' function according to the instructions. Remove the click method then u'd be fine.

$(document).ready(function(){
    $('.pink,.red').fadeTo('slow',0);
});

#3

Thank you! You are right