I have a simple example:
<li id="item0" class="test">
.....
<li id="item10" class="test">
How to remove class "test" from all elements this id =~ "#item\d{1,}" using jquery ?
Use the attribute starts with selector to get just those IDs:
$('li[id^="item"]').removeClass('test');
$(youritem).removeClass('test');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With