Categories
css function jquery

“removeAttribute is not a function” error message

mac firefox 3.6.13 firebug gives me this error: “removeAttribute is not a function”
I have read somewhere that “removeAttribute” is buggy in some browsers however I need to use it. If it is a browser problem can anyone suggest a different method.

function closeThumbView(){
$("#thumbReelBox").fadeOut(1000, function(){
$("#thumbReelList > li > a, #thumbReelList > li, #thumbReelNav, #thumbReelBox").removeAttribute('style');
});
}

Try to use DOM element removeAttribute() method:

function closeThumbView(){
$("#thumbReelBox").fadeOut(1000, function(){
els = $("#thumbReelList > li > a, #thumbReelList > li, #thumbReelNav, #thumbReelBox");
for(ind=0;ind<els.length;ind++){
els[ind].removeAttribute('style');
}
});
}

or if you want to use JQuery method, use removeAttr() as one of the respondents said:

function closeThumbView(){
$("#thumbReelBox").fadeOut(1000, function(){
els = $("#thumbReelList > li > a, #thumbReelList > li, #thumbReelNav, #thumbReelBox");
els.removeAttr('style');
});
}