I want to remove a class starting with "color". classes are added dynamically, I did not know many starts of classes with color.
<div id="sample" class="color1 orange color2 color3 blue"></div>
Jquery
$("#sample").removeClass("[class^='color']");
But that will not work. Any help?
jquery removeclass
albert jegani
source share