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

xcode - Swift Playground - Files are not readable -

jboss7.x - JBoss AS 7.3 vs 7.4 and differences -