Frage

I am trying to select all those li under a div having className ui-menu like having UL as their child element.

War es hilfreich?

Lösung

Try to use :has

$('div.ui-menu li:has(ul)')

Andere Tipps

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)')

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top