I have a page with a menu an two div.
<nav id="menu">
<ul>
<li><a href="#" class="active">soft1</a></li>
<li><a href="#">soft2</a></li>
</ul>
</nav>
<section>
<div id="soft1">
<p>content</p>
</div>
<div id="soft2">
<p>content</p>
</div>
</section>
On a click from the nav, I'd like to add a class named "active" on the menu link and to show the right div in the following. I will start with a active tab, so I have to remove the class if I click on the second.
For example : Click on the Soft2 link => add an "active" class on the soft2 link => remove the active class on the soft1 link => show the soft2 block.
I don't use any JS library. I'd like to write it in pure JS. Can you help me ?
Thank you