In this code snippet from AdvancED DOM Scripting:
Call delete(classes[i]);
Is this an array or object method? I can not answer Google.
/** * remove a class from an element */ function removeClassName(element, className) { if(!(element = $(element))) return false; var classes = getClassNames(element); var length = classes.length //loop through the array in reverse, deleting matching items // You loop in reverse as you're deleting items from // the array which will shorten it. for (var i = length-1; i >= 0; i--) { if (classes[i] === className) { delete(classes[i]); } } element.className = classes.join(' '); return (length == classes.length ? false : true); }; window['ADS']['removeClassName'] = removeClassName;
source share