Skip to content

I cant navigate through sections #9

Description

@AmirhosseinVosough

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');
		}
	});
`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions