Possible Duplicate:
Remove all classes that begin with a certain string
I have a script which adds one of six classes randomly to the body. The classes are numbered between 1 and 6, like this:
theme-1
to theme-6
.
I need a clean way to remove all of them. Right now I have this:
$('body').removeClass('theme-1');
$('body').removeClass('theme-2');
$('body').removeClass('theme-3');
$('body').removeClass('theme-4');
$('body').removeClass('theme-5');
$('body').removeClass('theme-6');
But it's kind of clunky right? Is there a way I can say "remove any classes between theme-1
to theme-6
"?