I am working on a page with 3 tabs at the top that need to change their styling when clicked. I have successfully implemented this using the .toggleClass('active') function and applying CSS to the 'active' class.
Now, I need to display related content in the body of the page when each tab is clicked. Here's what I have so far:
<ul>
<li class="active">Primary</li>
<li>Secondary</li>
<li>Tertiary</li>
</ul>
<div class="tabs">
<div class="slate">Content1</div>
<div class="slate">Content2</div>
<div class="slate">Content3</div>
</div>
When an li is clicked, it applies the 'active' class (working), but I also want it to show the content from the corresponding div within the 'tabs' container. For example, clicking on 'Primary' should display the content from the first child in the 'tabs' div.
Thank you!