dom-class.js revision 01c9ad7a2d020df6a71393fe05dfa2061e539e11
/**
* Determines whether a DOM element has the given className.
* @method hasClass
* @param {HTMLElement} element The DOM element.
* @param {String} className the class name to search for
* @return {Boolean} Whether or not the element has the given class.
*/
},
/**
* Adds a class name to a given DOM element.
* @method addClass
* @param {HTMLElement} element The DOM element.
* @param {String} className the class name to add to the class attribute
*/
}
},
/**
* Removes a class name from a given element.
* @method removeClass
* @param {HTMLElement} element The DOM element.
* @param {String} className the class name to remove from the class attribute
*/
}
}
},
/**
* Replace a class with another class for a given element.
* If no oldClassName is present, the newClassName is simply added.
* @method replaceClass
* @param {HTMLElement} element The DOM element.
* @param {String} oldClassName the class name to be replaced
* @param {String} newClassName the class name that will be replacing the old class name
*/
//Y.log('replaceClass replacing ' + oldC + ' with ' + newC, 'info', 'Node');
},
/**
* If the className exists on the node it is removed, if it doesn't exist it is added.
* @method toggleClass
* @param {HTMLElement} element The DOM element.
* @param {String} className the class name to be toggled
*/
} else {
}
}
});