/** @author https://gist.github.com/peteboere/1517285 */ $.fn.alterClass = function (removals, additions) { var self = this;
if (removals.indexOf('*') === -1) { // Use native jQuery methods if there is no wildcard matching self.removeClass(removals); return !additions ? self : self.addClass(additions); }