Horje
first remove active class from classlist and append to current element using javascript Code Example
first remove active class from classlist and append to current element using javascript
function myFunction(e) {
  if (document.querySelector('#navList a.active') !== null) {
    document.querySelector('#navList a.active').classList.remove('active');
  }
  e.target.className = "active";
}




Javascript

Related
split string into two parts javascript Code Example split string into two parts javascript Code Example
on_raw_reaction_add example Code Example on_raw_reaction_add example Code Example
how to check if an element is in an array javascript Code Example how to check if an element is in an array javascript Code Example
update table remove a key from json object mysql Code Example update table remove a key from json object mysql Code Example
passport.authenticate inside a controller Code Example passport.authenticate inside a controller Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9