Javascript preventDefault operation

dom-eventshtmljavascriptjquery

I'm just practising some JavaScript and I came across an error I can't get around. I have a list in my html where each item links to a page, but
I have a function in my js script where when I click the item its supposed to remove the item from the list, I'm trying to use preventDefault() but it still takes me to that link.

<ul id="shoppingList">
        <li class="complete"><a href="google.com><em>fresh</em>tuna</a></li>
        <li class="complete"><a href="google.com">meatball</a></li>
        <li class="complete"><a href="google.com">kiwi</a></li>
        <li class="complete"><a href="google.com">chicken soup</a></li>
    </ul> 

function getTarget(e){
if(!e){
    e = window.event;
} 
return e.target || e.srcElement;}

function itemDone(e){
//Remove item from the list
var target;
var Parent;
var Grandparent;
target = getTarget(e);
Parent = target.parentNode;
Grandparent = target.parentNode.parentNode;
Grandparent.removeChild(Parent);

//Prevent the link from taking you somewhere
if(e.preventDefault){
    e.preventDefault();
}else{
    e.returnValue = false;
}
}

//Set up event listeners to call ItemDone() on click
var Shoppo = document.getElementById('shoppingList');
if(Shoppo.addEventListener){
Shoppo.addEventListener('click',function(e){
    itemDone(e);
},flase);
}else{
Shoppo.attachEvent('onClick',function(e){
    itemDone(e);
});
}

Best Solution

To check if the e.preventDefault() was called, you can use isDefaultPrevented which returns true or false. So you can change your code like this,

e.preventDefault();
if(e.isDefaultPrevented()){
    // default event is prevented
}else{
    e.returnValue = false;
}