Marc V Marc V - 1 month ago 3
jQuery Question

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");