I am working on a navigation system that looks like this:
<nav class="subnav">
<ul>
<li><a href="a.html">This link leads to content A.</a></li>
<li><a href="a.html">This link goes to content B.</a></li>
<li><a href="a.html">This link directs to content C.</a></li>
</ul>
</nav>
and another one that looks like this:
<nav class="subnav">
<ul>
<li><a href="1.html">This link takes you to content 1.</a></li>
<li><a href="1.html">This link leads to content 2.</a></li>
<li><a href="3.html">This link directs to content 3.</a></li>
</ul>
</nav>
I am looking for a solution to implement a feature where the user can swap between these two subnav elements using an onclick event. If the user selects Alphabetical Group, the second subnav should be removed and the first one displayed. Conversely, if the user chooses Numerical Group, the first subnav should be replaced with the second.
In addition, there should be a default state set initially.
Any ideas on how I can achieve this functionality?