<ul>
  <li>Item n.1</li>
  <li>Item n.2</li>
  <li>Item n.3</li>
</ul>
const onRemoveNode = event =>
  event.target.remove()

const addListener = element =>
  element.addEventListener('click', onRemoveNode)

const listItems = document.querySelectorAll('li')
listItems.forEach(addListener)
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.