From 09058657af52027d3cfef1c26ffeeba35eb5547a Mon Sep 17 00:00:00 2001 From: Diana <40689028+ausiejute@users.noreply.github.com> Date: Thu, 19 Nov 2026 22:28:30 +0000 Subject: [PATCH 1/8] Change the title in the html file --- Sprint-3/todo-list/index.html | 78 +++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 31 deletions(-) diff --git a/Sprint-3/todo-list/index.html b/Sprint-3/todo-list/index.html index 4d12c46543..ff54548bdf 100644 --- a/Sprint-3/todo-list/index.html +++ b/Sprint-3/todo-list/index.html @@ -1,40 +1,56 @@ - + - - - - ToDo List - - + + + + ToDo List + + - - - -
-

My ToDo List

+ + + +
+

My ToDo List

-
- - -
+
+ + + +
- + - - - -
- + +
+ From 126bfb0b1b0e859204eac3af96f771a59b865949 Mon Sep 17 00:00:00 2001 From: Diana <40689028+ausiejute@users.noreply.github.com> Date: Fri, 20 Nov 2026 01:11:16 +0000 Subject: [PATCH 2/8] Fix button name in html file --- Sprint-3/todo-list/index.html | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Sprint-3/todo-list/index.html b/Sprint-3/todo-list/index.html index ff54548bdf..9465aeb668 100644 --- a/Sprint-3/todo-list/index.html +++ b/Sprint-3/todo-list/index.html @@ -23,9 +23,7 @@

My ToDo List

placeholder="Enter a new task..." /> - + @@ -45,9 +43,6 @@

My ToDo List

- From 1f3ed49c22caf59be0a524ed29d4c7c1722d88f4 Mon Sep 17 00:00:00 2001 From: Diana <40689028+ausiejute@users.noreply.github.com> Date: Fri, 20 Nov 2026 01:13:35 +0000 Subject: [PATCH 3/8] Implement a function deleteCompleted --- Sprint-3/todo-list/script.mjs | 29 +++++++++++++++++------------ Sprint-3/todo-list/todos.mjs | 10 +++++++++- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/Sprint-3/todo-list/script.mjs b/Sprint-3/todo-list/script.mjs index ba0b2ceaec..9abf6dac02 100644 --- a/Sprint-3/todo-list/script.mjs +++ b/Sprint-3/todo-list/script.mjs @@ -1,4 +1,4 @@ -// Store everything imported from './todos.mjs' module as properties of an object named Todos +// Store everything imported from './todos.mjs' module as properties of an object named Todos import * as Todos from "./todos.mjs"; // To store the todo tasks @@ -7,16 +7,17 @@ const todos = []; // Set up tasks to be performed once on page load window.addEventListener("load", () => { document.getElementById("add-task-btn").addEventListener("click", addNewTodo); - + document + .getElementById("delete-completed-tasks-btn") + .addEventListener("click", deleteCompleted); // Populate sample data - Todos.addTask(todos, "Wash the dishes", false); + Todos.addTask(todos, "Wash the dishes", false); Todos.addTask(todos, "Do the shopping", true); - + ////////Todos.deleteCompleted(todos); render(); }); - -// A callback that reads the task description from an input field and +// A callback that reads the task description from an input field and // append a new task to the todo list. function addNewTodo() { const taskInput = document.getElementById("new-task-input"); @@ -29,6 +30,11 @@ function addNewTodo() { taskInput.value = ""; } +function deleteCompleted() { + Todos.deleteCompleted(todos); + render(); +} + // Note: // - Store the reference to the