addEventListener call only once code example
Example: addEventListener call only once
var list = document.getElementsByTagName('ul')[0]
list.addEventListener('click', function(e){
var el = e.target
// walk up the tree until we find a LI item
while (el && el.tagName !== 'LI') {
el = el.parentNode
}
console.log('item clicked', el)
},{ once: true }) // when we use once as true, it will never call again