1function remove(elem){
2 elem.parentNode.removeChild(elem);
3}
4<div id="i", onclick="remove(this)">click</div>
1function itemDone(e) {
2 var target, elParent, elGrandParent;
3
4 //Remove Item From the list
5 target = e.target;
6 // alert(e.target.value);
7 elParent = target.parentNode;
8 elGrandParent = elParent.parentNode;
9
10 alert(target.parentNode.innerHTML + " Removed From Cart")
11 elGrandParent.removeChild(elParent);
12
13 //prevent the link from taking you elsewhere
14 e.preventDefault();
15}
16
17// Set up event listeners to call itemDone() on click
18document.getElementById("shoppinglist").addEventListener('click', function(e) {
19 itemDone(e);
20}, false);