Skip to content

Instantly share code, notes, and snippets.

@henriquetroiano
Created May 20, 2020 16:35
Show Gist options
  • Save henriquetroiano/9eb47ae699569d623e3ac44217063916 to your computer and use it in GitHub Desktop.
Save henriquetroiano/9eb47ae699569d623e3ac44217063916 to your computer and use it in GitHub Desktop.
Selectors
const menu__sel = document.querySelectorAll('.menu_content li'); // select all items from menu
menu__sel.forEach((thisLi) => {
thisLi.addEventListener('mouseover', function() {
thisLi.classList.add('active')
})
thisLi.addEventListener('mouseout', function() {
thisLi.classList.remove('active')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment