Skip to content

Instantly share code, notes, and snippets.

@ohiosveryown
Created April 26, 2018 19:31
Show Gist options
  • Save ohiosveryown/7b7e049f2653f4113ee1271faccdc3fc to your computer and use it in GitHub Desktop.
Save ohiosveryown/7b7e049f2653f4113ee1271faccdc3fc to your computer and use it in GitHub Desktop.
Arrow Function Shorthand
const trigger = document.querySelector('button')
trigger.addEventListener('click', () => {
document.querySelector('h1').classList.add('blue')
})
trigger.addEventListener('mouseenter', () => {
document.querySelector('h1').classList.add('blue')
})
trigger.addEventListener('mouseleave', () => {
document.querySelector('h1').classList.remove('blue')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment