<ul> <li> <ul></ul> </li> <li></li> <li></li> <li></li> <li> <ul></ul> </li> </ul>
How to add class="parent"only for liwhich has ulinside it?
class="parent"
li
ul
You can use :has()in your selector, for example:
:has()
$("li:has(ul)").addClass("parent")
Source: https://habr.com/ru/post/1778961/More articles:Subsonic 3.0 ActiveRecord with dates - c #Эффект завивки страницы/поворота на Android - androidMenu in the form of prism areas + problem with themes - wpfUsing pch characters in grid.text - rHow to create an XDocument instance to load an XML file after deserializing an object? - c #Можно ли ограничить пропускную способность, используемую Amazon S3? - amazonHow to create a table with a table in SSRS - reporting-servicesAndroid programming SMS - androidI want to get one specific record from a JSON data array and make some changes - jsonhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1778966/hibernate-criteria-how-to-limit-join-results-to-a-single-entity-type&usg=ALkJrhh8wrka2V2NUmvqZSHFsYLeYilrIgAll Articles