Why does jQuery throw the error `fadeOut is not a function’?

I am using jQuery and put this code in my javascript:

function HideMe(itemID) {
    var myDiv = 'item_' + itemID;
    $(myDiv).fadeOut("slow");
}

But its giving me this error: fadeOut is not a function.

Answer

Do you have another javascript library on that page? It seems you have the hide function, and the $ defined (prototype, for example, also has an hide function).
If that is the case, try:

jQuery("#item_0").fadeOut("slow");

Leave a Reply

Your email address will not be published. Required fields are marked *