Skip to content

Instantly share code, notes, and snippets.

@coltpini
Created May 5, 2017 17:33
Show Gist options
  • Save coltpini/244655577557858b45bc6ece126bfbcf to your computer and use it in GitHub Desktop.
Save coltpini/244655577557858b45bc6ece126bfbcf to your computer and use it in GitHub Desktop.
// in the DOM
someElement.addEventListener('someEvent', someHandler);
// Simple familiar example that removes the element when it is clicked.
someElement.addEventListener('click', (e) => e.target.remove());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment