Html tab
 
javascript tabs example
const showHideAll =(list)=>{
for(var i = 0; i < list.length; i++){
list[i].classList.remove('show');
list[i].classList.add('hide'); // depending on what you're doing
}
}
window.onload = function() {
let innerDiv = document.getElementsByClassName("inner-description");
let clicked = document.querySelectorAll('.show-hide-description');
clicked.forEach((item, i) => {
let clickedId = item.id;
document.querySelector(`#${clickedId}`).addEventListener('click',()=>{
let clickedIdDescription = document.getElementById(`${clickedId}-description`);
if(clickedIdDescription.classList.contains('show')){
showHideAll(innerDiv)
} else {
showHideAll(innerDiv)
clickedIdDescription.classList.remove('hide');
clickedIdDescription.classList.add('show');
}
})
});
}
tab view in html
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="false">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact" aria-selected="false">Contact</a>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">...</div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">...</div>
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">...</div>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us