What JQuery selector excludes items with a parent that matches a given selector?

前端 未结 7 822
Happy的楠姐
Happy的楠姐 2020-12-02 16:39

I have

var $set = $(\'.foo,.bar\').filter(
    function() {return $(this).parents(\'.baz\').length < 1;});

as a way to select all the el

7条回答
  •  时光说笑
    2020-12-02 16:53

    var $li = jQuery('li', this).not('.dropdown-menu > li');

    I'm using Roots theme and they change the dropdowns from 'sub-menu' to '.dropdown-menu'

提交回复
热议问题