showing results for - "first remove active class from classlist and append to current element using javascript"
Catalina
24 Apr 2017
1function myFunction(e) {
2  if (document.querySelector('#navList a.active') !== null) {
3    document.querySelector('#navList a.active').classList.remove('active');
4  }
5  e.target.className = "active";
6}