Update scripttodo.js

This commit is contained in:
WhyKorp
2024-03-11 06:46:10 +01:00
committed by GitHub
parent 8931ef5cb1
commit 766d396461
-8
View File
@@ -39,14 +39,6 @@ document.addEventListener("DOMContentLoaded", function() {
addTodoButton.addEventListener("click", function() {
const todoText = newTodoInput.value.trim();
if (todoText !== "") {
const todoItem = document.createElement("li");
const todoCheckbox = document.createElement("input");
todoCheckbox.type = "checkbox";
const todoSpan = document.createElement("span");
todoSpan.textContent = todoText;
todoItem.appendChild(todoCheckbox);
todoItem.appendChild(todoSpan);
todoList.appendChild(todoItem);
addTodoToList(todoText);
saveTodoList();
newTodoInput.value = "";