Open
Description
HI guys. I have a problem that I cant navigate through pages with buttons.
I have checked my js file for thousand times and it still doesn't
work.
Also I receive <TypeError: allSections.addEventListener is not a function> this error.
I would appreciate if some one help.
` //sections active class
allSections.addEventListener('click' , (e) => {
const id=e.target.dataset.id;
if(id){
//remove selected from the other btns
sectBtns.foreach((btn) =>{
btn.classlist.remove('active');
})
e.target.classlist.add('active');
//hide other sections
sections.foreach((section)=>{
section.classlist.remove('active');
})
const element = document.getElementById(id);
element.classlist.add('active');
}
});
`
Metadata
Metadata
Assignees
Labels
No labels