Accordion with unordered list and sub-list

How do I create an jQuery accordion of an unordered list with sub-lists, where the “Second” and “Fourth” links navigate to the page, not opens or closes the sub-list?

<ul>
<li><a href="first.html">First</a></li>
<li><a href="second.html">Second</a> (+)
<ul>
<li>Sub-first</li>
<li>Sub-second</li>
<li>Sub-third</li>
</ul>
</li>
<li><a href="third.html">Third</a></li>
<li><a href="fourth.html">Fourth</a> (+)
<ul>
<li>Sub-first</li>
<li>Sub-second</li>
<li>Sub-third</li>
</ul>
</li>
<li><a href="fifth.html">Fifth</a></li>
</ul>

How do you intend to show the sub lists of the Second and fourth links if you navigate away? Did you intend that just the plus sign toggles the sublist but the actual link navigates.

I’m not quite clear on your intention:)

1 Like