I am trying to select all those li under a div having className ui-menu like having UL as their child element.
selecting only those li having ULs
76 Views Asked by user160820 At
2
There are 2 best solutions below
0
On
You can use the :has() selector.
In case you meant that the div is the one to have the .ui-menu class use this:
$('div.ui-menu li:has(ul)')
In case you meant that the li is the one to have the .ui-menu class use this:
$('div li.ui-menu:has(ul)')
Try to use :has