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

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

How can I apply jQuery

8条回答
  •  爱一瞬间的悲伤
    2020-12-09 09:29

    if (!$('#yourDiv').children().hasClass("className")) {
        //i.e. yourDivID' has no any children whose class name =>'className'
    }
    

提交回复
热议问题