MCPcopy Create free account
hub / github.com/AyushSaini00/60minuteJavaScript / deleteTodo

Function deleteTodo

Todo-List/app.js:47–65  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

45}
46
47function deleteTodo(e){
48 const item = e.target;
49
50 if(item.classList[0] === 'trash-btn'){
51 const todo = item.parentElement;
52 todo.classList.add('fade-away');
53
54 todo.addEventListener('transitionend', e => {
55 todo.remove();
56 });
57 }
58
59 if(item.classList[0] === 'complete-btn'){
60 const todo = item.parentElement;
61 const todoItem = todo.querySelector('.todo-item');
62 todoItem.classList.toggle('completed');
63
64 }
65}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected