From e5e5cd4fe0c1ee8966eb1d3e99a5cbebe3deebb0 Mon Sep 17 00:00:00 2001 From: Faizal Hassan <161876313+iamfaizall20@users.noreply.github.com> Date: Fri, 30 May 2025 10:19:00 -0700 Subject: [PATCH] updated function in TO DO App Project --- 01-To-Do List App/script.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/01-To-Do List App/script.js b/01-To-Do List App/script.js index c88565b..f72ad35 100644 --- a/01-To-Do List App/script.js +++ b/01-To-Do List App/script.js @@ -1,7 +1,7 @@ const buttonEl = document.querySelector("#button"); const todoList = document.querySelector("#todo_list"); -function addTodo() { +buttonEl.addEventListener("click",function(){ const li = document.createElement("li"); let inputValue = document.querySelector(".input").value; const t = document.createTextNode(inputValue); @@ -15,6 +15,4 @@ function addTodo() { } console.log(inputValue); document.querySelector("input").value = ""; -} - -buttonEl.addEventListener("click", addTodo); +}); \ No newline at end of file