This also works - In the link HTML use onclick with return like this :
Delete
And then the comfirmClick() function should be like:
function confirmClick() {
if(confirm("Do you really want to delete this task?")) {
return true;
} else {
return false;
}
};