1// delete an element from the dom
2var elem = document.querySelector('#some-element');
3elem.parentNode.removeChild(elem);
4
5
6// keep element in dom
7var elem = document.querySelector('#some-element');
8elem.style.display = 'none';
9
1function removeItem(e) {
2 var target = e.target;
3 if(target.tagName !== 'LI') return;
4 target.parentNode.removeChild(target);
5}
6list.addEventListener('click', removeItem);
7