I'm doing the following right now which works great:
$('#picker a').removeClass('selected');
where:
<div id="picker">
<a href="" class="selected">Stuff</a>
<a href="" class="selected">Stuff</a>
<a href="" class="">Stuff</a>
<a href="" class="selected">Stuff</a>
</div>
How can I update the jQuery to say, remove class selected from all BUT the first row. Ignore the first row in picker.
Thanks
$('#picker > a').slice(1).removeClass('selected');
This uses a valid querySelectorAll
selector, along with the slice()
(docs) method which will be very fast.
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