$('.change').click(function() {
$('.link').each(function(e) {
var color = this.className.match(/color-\w+/gi);
alert(color);
});
});
I'd basically like this to alert the regular expression found with \w+ rather than the entire string. How can I do this?
Additionally, how can I remove color- without removing the regular expression after this instance?