Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhanu280801 authored Aug 28, 2024
1 parent 36197d4 commit 7030da1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

// function to delete a todo item
function deleteTodo(index) {
// get the todo item by index and store it in a variable called todo
// get the todo item by index and store it in a variable called element
const element = document.querySelector(`#todo-${index}`);

// remove the todo item from the DOM
// element.remove();

// remove the todo item from the DOM
element.parentNode.removeChild(element);
}
}

0 comments on commit 7030da1

Please sign in to comment.