I'm using nth-child in my jquery selector to identify columns to modify. I have 5 columns (1-5) and I want to modify only 2,3, and 4. Is there a way to do this with nth-child? Something like:
$('#example tbody tr td:nth-child(2||3||4)')
I have tried several combinations but nothing seems to work. Im pretty new to jQuery selectors any help you could throw at me would be greatly appreciated.
Regards, Joe Chin
You could use .nextUntil()
like this:
$('#example tbody tr td:nth-child(1)').nextUntil(':nth-child(5)');
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