문제

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

도움이 되었습니까?

해결책

Try to use :has

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

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top