Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const tabMenu = document.querySelectorAll('.js-tabmenu li')
- const tabContent = document.querySelectorAll('.js-content section');
- if(tabMenu.length && tabContent.length){
- function activeTab(index){
- tabContent.forEach((section)=>{
- section.classList.remove('ativo');
- });
- tabContent[index].classList.add('ativo');
- }
- tabMenu.forEach((itemmenu,index)=>{
- itemmenu.addEventListener('click', ()=>{
- activeTab(index);
- });
- });
- }
Add Comment
Please, Sign In to add comment