From 8cad560d7f9e4a63897a6b1d227c0347df8e94ab Mon Sep 17 00:00:00 2001 From: Abdulrazaq544 Date: Sun, 22 Feb 2026 13:54:54 -0800 Subject: [PATCH 1/2] Add error message paragraph in index.html --- public/index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/index.html b/public/index.html index a4e0fac..4daba21 100644 --- a/public/index.html +++ b/public/index.html @@ -7,6 +7,8 @@ +

Please enter a task!

From 3141f0aec7aebbc89e2fde5fc9d40141ac22061b Mon Sep 17 00:00:00 2001 From: Abdulrazaq544 Date: Sun, 22 Feb 2026 13:56:34 -0800 Subject: [PATCH 2/2] Add error handling for task input validation Fix error handling for task input and display error message. --- public/script.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index 9c6912e..ae4e7c0 100644 --- a/public/script.js +++ b/public/script.js @@ -9,4 +9,14 @@ document.addEventListener('DOMContentLoaded', () => { console.log("App Initialized"); // Load tasks will be called here later (Issue #9) }); - + addBtn.addEventListener('click', () => + { + const text = taskInput.value.trim(); + const errorMsg = document.getElementNyId('error-msg'); + if (text === ") { + errorMsg.style.display = 'block'; + return; + } + errorMsg.style.display = 'none';addTask(text); + taskInput.value = "; + });