Please I need to apply the toggle() function to only li that has ul has children in its structure.
For example
<div>
<ul>
<li>
<a></a>
<ul>
<li></li>
</ul>
</li>
<li><a></a></li>
</ul>
</div>
From the above my aim is to apply the toggle() function to the a element(s) that have no ul has a sibling.
How can I achieve this.
Try this:
Example fiddle here