8. Now sure why this doesn't work


#1

$(".pink, .red").fadeTo("slow", 0);


#2

As you can learn from
= https://api.jquery.com/multiple-selector/
your jQuery Selektor

$(".pink,.red")

you are creating a jQuery-Object which contains
a Selecting of all HTML-Elements
which are carrying the class-attribute with the class-name's "pink" OR "red"

On these Selected-HTML-Elements you execute the jQuery-fadeTo() method
and you give this fadeTo()-Method the arguments 'slow' and a numeric-Value 0

As you can learn from
https://api.jquery.com/fadeTo/
the fadeTo()-method has 3 parameter's
fadeTo( duration, opacity [, complete ] )
duration=>slow=>600ms

opacity=> http://techterms.com/definition/opacity => 0 is completely transparent (or invisible)
( the DOM-Element is only invisible, NOT removed(), the rest-Elements hold their position!! )

If you want to remove() the HTML-Element from the DOM

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

#3

@ly900,
It would be interesting to know which Browser and operating system you are using.

It could also be...
++++ reset of session *****************

under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).


#4

The full answer is:

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

I made the mistake of only having the second line but not adding it within the document function.


#5

Thank you for your full answer!!