Tell us what’s happening:
I don’t think I fully understand what is happening when I call the parentElement (or childElement) but right now the error code I can’t shake is “You should use the remove() method to remove the parent element of buttonEl.” I had “buttonEl.remove(parentElement);” before, and a few other similar things.
Your code so far
const deleteTask = (buttonEl) => {
const dataArrIndex = taskData.findIndex(
(item) => item.id === buttonEl.parentElement.id
);
remove(buttonEl.parentElement);
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/122.0.0.0 Safari/537.36
Challenge Information:
Learn localStorage by Building a Todo App - Step 38