function removeItem(e) { var target = e.target; if(target.tagName !== 'LI') return; target.parentNode.removeChild(target); } list.addEventListener('click', removeItem);