I would like to affect all my elements containing a class almost similar, i could iterate and use the iterator to do the job, but i am wondering if we could use a regex in this case:
$('.player').removeClass('player-1 player-2 player-3'); //player-n
Can the jQuery removeClass
(and globaly the jquery methods which affects the DOM) treat a regex here ?
I am trying this:
$('.player').removeClass('/player-[0-9]+/');
The regex match i have tested it here, but it doesn't work on my DOM, does jQuery support the regex in this case?