html - less: how to match only those <li> with <ul> children -


this question has answer here:

i have nested list , want match <li> lines have <ul> sub-lists.

for example in following list want match cats, devious , dogs, not playful, destructive, deadly, fast , smart.

<ul> <li>cats   <ul>   <li>playful</li>   <li>devious     <ul>     <li>destructive</li>     <li>deadly</li>     </ul>   </li>   </ul> </li> <li>dogs   <ul>   <li>fast</li>   <li>smart</li>   </ul> </li> </ul> 

how do that?

that's not possible in css or less, if can use jquery, this:

$("li"):has("ul,li").addclass('childclass');

hope helps!


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -