JQuery - 6. Selecting by Class


#1

Does anybody know why it doesn't work?
I wrote:

$(document).ready(function() {
    $("button").click(function() {
        function(".vanish").fadeOut("slow");
    });
});

but the squares do not vanish.
thanks


#2

Hi Dorelian,

You need to replace function there with something else - do you know what?

Hint

Since fadeOut() is a jQuery thing, you need to call the jQuery function, or use it's alias:

jQuery('.vanish')
// or
$('.vanish')

:wink:


#3

course, $, sorry for wasting your time, Zystvan...thanks


#4

No worries, helping other people is never a waste of time :slight_smile:


#5

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.