My scenario is as follows, I have two ul
with li
. The uls
have the same class, but I wanted to manipulate only one of them, in the case, which has only a li
as a daughter.
Example: link
Example 2:
<ul class="teste">
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
<ul class="teste">
<li>1</li>
</ul>
I need to manipulate only the% with test% that has only 1 child , which in this case is the second.
I thought about selecting all ul
, and doing a check with uls
, if it was greater than childElementCount
, I would apply a CSS in 1
, otherwise, nothing would happen. But I tried to use ul
itself and could not make the comparison, I tried childElementCount
too.