more class functions…
Update: changed from Object.prototype.hasClass(className) to simply hasClass(element, className) for cross-browser compatibility
Ok… nothing to revolutionary here. This has been done before lots of times. I’ve written two new functions to go along with my hasClass() javascript function.
First is addClass(), which simply adds a class to an object, while preserving the existing classes. Here it is:
function addClass( [...]