Select bookmark link in a web page and add active class on selected bookmark in another page

36 Views Asked by At

I have 5 different bookmarks in a menu, each one navigates the user to another web page with 5 tabs with id of selected bookmark and 5 tab each one has some class name as its tab id. I want a javascript function that get selected bookmark href in first page and add active class to its own tab has bookmark id and its section with same class as its id

I try to select href and set it === to id name, and if it is true, set active class on class name and id by its index from 0_4 ، and else remove active class from class name and id , but it doesn't work

0

There are 0 best solutions below