I have set of 6 elements and I would like to filter by every second and third element so I want to have elements 2, 3, 5 and 6. I’ve tried .filter(':nth-child(2n+1)')); but obviously that filters the 2, 4, and 6.
The other way I was trying was to remove elements 1 and 4, but I couldn’t find a jQuery function that was the opposite of filter that would remove the elements from the set.
Going by your example, I don’t think you actually want 2n and 3n. You want the 2nd and 3rd out of every group of 3? Then either one of these should work: