Skip to content

Instantly share code, notes, and snippets.

@aaronmcadam
Created June 29, 2011 10:19
Show Gist options
  • Select an option

  • Save aaronmcadam/1053597 to your computer and use it in GitHub Desktop.

Select an option

Save aaronmcadam/1053597 to your computer and use it in GitHub Desktop.
remove a class based on a pattern
$(slider).parent().find('.rating').removeClass(function(index, elementClass) {
matches = elementClass.match(/rating-[0-9]+/);
if( $(matches).length ) {
return matches.join(' ');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment