Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save achraf-jeday/3dce48d6462949f38d8f7207b08b050d to your computer and use it in GitHub Desktop.
Save achraf-jeday/3dce48d6462949f38d8f7207b08b050d 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