Skip to content

Instantly share code, notes, and snippets.

@KATT
Created September 4, 2014 12:37
Show Gist options
  • Save KATT/9643b4e0597e6dc6fc11 to your computer and use it in GitHub Desktop.
Save KATT/9643b4e0597e6dc6fc11 to your computer and use it in GitHub Desktop.
$.fn.removeClassStartingWith = function(str) {
return this.removeClass(function(i, classNames) {
return $.grep(classNames.split(' '), function(className) {
return className.indexOf(str) === 0;
}).join(' ');
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment