How to select and remove class from an element based on string?
E.g
How to remove class="s2" from element <p class="s2 s4 s5"></p>
I’m looking for way to select class based on number – e.g ‘s’ can be string on any signs.
Please note that the order can be different.
Any suggestion much appreciated.
Try this:
Here’s a working JS Fiddle
EDIT
As someone pointed out in the comments, the above code will only remove the CSS classes from the first
ptag (as per your example). The code below will remove all CSS classes ending in two from allpelements.