How can I select an element which does not contain a certain child element?

前端 未结 8 1123
抹茶落季
抹茶落季 2020-12-09 09:03

How can I apply jQuery

相关标签:
8条回答
  • 2020-12-09 09:39

    You could use the method children with ".example" and test if it is empty

    0 讨论(0)
  • 2020-12-09 09:40
     $('.test').each(function() {
        if(!$(this).children().hasClass("example")){
           //your code
        }
    }); 
    

    Maybe like this? I haven't tested this...

    0 讨论(0)
提交回复
热议问题