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


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?


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.



Thank you! You are right