Skip to content

Instantly share code, notes, and snippets.

@imcmahon
Created May 15, 2014 17:12
Show Gist options
  • Save imcmahon/4335d05967f54bb6d14e to your computer and use it in GitHub Desktop.
Save imcmahon/4335d05967f54bb6d14e to your computer and use it in GitHub Desktop.
jQuery remove all classes with the same prefix
$('html').removeClass(function (index, css) {
return (css.match (/\bpage-\S+/g) || []).join(' '); // removes anything that starts with "page-"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment