From dc7cd1033660b5b349e1c2fd1bc2c487a495db8e Mon Sep 17 00:00:00 2001 From: Devansh3059 <42404373+Devansh3059@users.noreply.github.com> Date: Fri, 8 Oct 2021 19:07:37 +0530 Subject: [PATCH] Update app.js Devil was here --- app.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index a758ea9..44f3266 100644 --- a/app.js +++ b/app.js @@ -1,4 +1,4 @@ -//Selectors +//DOM Selectors const todoInput = document.querySelector('.todo-input'); const todoButton = document.querySelector('.todo-button'); const todoList = document.querySelector('.todo-list'); @@ -10,7 +10,7 @@ todoButton.addEventListener('click', addTodo); todoList.addEventListener('click', deleteCheck); filterOption.addEventListener('click',filterTodo); -//Function +//Function TO add list function addTodo (Event){ //To Prevent from Submitting event.preventDefault(); @@ -51,6 +51,8 @@ function addTodo (Event){ } +//Function to delete + function deleteCheck(e){ //console.log(e.target); const item = e.target; @@ -169,4 +171,4 @@ function removeLocalTodos(todo){ const todoIndex = todo.children[0].innerText; todos.splice(todos.indexOf(todoIndex),1); localStorage.setItem('todos', JSON.stringify(todos)); -} \ No newline at end of file +}