6
My scenario is this, I have two ul
with li
. As uls
have the same class, but I wanted to manipulate only one of them, in this case, the one that has only one li
as a daughter.
Example: http://codepen.io/anon/pen/OMXpVg
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 just the ul
test that have only 1 child, which in this case is the second.
I thought I’d select all the uls
, and make a check with the childElementCount
, if it were bigger than 1
, I would apply a CSS to ul
, if not, nothing would happen. But I tried to use childElementCount
and I couldn’t make the comparison, I tried the .find()
also.
I don’t understand what you want to do.
– PauloHDSousa
Look at this
– durtto
@Paulohdsousa, see if you understand now
– haykou