How would I go about adding a class only to the li parent that has children?
<ul>
<li><a href="#">parent</a></li>
<li><a href="#">parent</a>
<ul>
<li>child</li>
<li>child</li>
</ul>
</ul>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
or
The first version may be marginally faster if you do:
…hard to say though without testing.
All of these use fully valid CSS selectors.