JQuery nth-child which is not 3n + 6

Hi i am trying to access every child that is not 3n + 6 something like this $('div:nth-child(!3n+6)')

is there a way to select every child that is not 3n + 6 in jquery

+3


source to share


2 answers


$('div:not(:nth-child(3n+6))') 

      



should work fine

+12


source


You can use : not () to indicate some element to avoid.

$('.div:not(:nth-child(3n+6))')

      



or

$('.div').not(":nth-child(3n+6)")

      

+3


source







All Articles