how to remove class in all siblings javascript

Solutions on MaxInterview for how to remove class in all siblings javascript by the best coders in the world

showing results for - "how to remove class in all siblings javascript"
Lynne
31 Jul 2019
1const setActive = el => {
2    [...el.parentElement.children].forEach(sib => sib.classList.remove('active'))
3    el.classList.add('active')
4    }