How to ignore multiple classes using the :not selector?

后端 未结 2 1859
挽巷
挽巷 2020-12-08 09:04

I have this selector below where it ignores any li with the class show-all-boxes

$(\'.boxes li:not([class=\"show-all-boxes\"])         


        
相关标签:
2条回答
  • 2020-12-08 09:37

    The :not selector can take multiple CSS selectors as arguments ( http://api.jquery.com/not-selector ). E.g.

    $('div:not(.a,.b)').empty()
    

    http://jsfiddle.net/HFfcP/

    0 讨论(0)
  • 2020-12-08 09:51

    try this :

    $('.boxes li').not(".show-all-boxes, .show-all-circles, .show-all-triangles").find('input:checkbox')
    
    0 讨论(0)
提交回复
热议问题