Can anyone tell me what am i doing wrong it’s giving me the error You should use the remove()
method to remove the parent element of buttonEl
.
Your code so far
const deleteTask = (buttonEl) => {
const dataArrIndex = taskData.findIndex(
(item) => item.id === buttonEl.parentElement.id
);
buttonEl.parentNode.remove();
taskData.splice(dataArrIndex, 1);
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Challenge Information:
Learn localStorage by Building a Todo App - Step 38