Recently, I have been experimenting with implementing tabs on one of my webpage. Here is the code snippet I have been working with.
<div class="row justify-content-between">
<div class="col-lg-3">
<a class="nav-link p-3 mb-2 sidebar-link justify-content-between text-success ml-4" href="#1" data-toggle="tab">
<h4 class="text-success size">Vehicles</h4>
</a>
<a class="nav-link p-3 mb-2 sidebar-link justify-content-between ml-4" href="#2" data-toggle="tab">
<h4 class="text-success size">Battery</h4>
</a>
<a class="nav-link p-3 mb-2 sidebar-link justify-content-between ml-4" href="#3" data-toggle="tab">
<h4 class="text-success size">Charging</h4>
</a>
</div>
<div class="tab-content col-lg-9">
<div class="tab-pane active" id="1">
<!-- Content here -->
</div>
<div class="tab-pane" id="2">
<!-- content here -->
</div>
<div class="tab-pane" id="3">
<!-- content here -->
</div>
</div>
</div>
What I have tried so far is to create a layout with two columns - one for the tab links and the other for displaying content based on the clicked link. Initially, the code seems to work fine as the content changes when the links are clicked for the first time. However, subsequent clicks do not update the content. It only seems to work once. Can anyone suggest a solution to make the tab functionality work seamlessly no matter how many times the links are toggled?