Update scripttodo.js
This commit is contained in:
@@ -39,14 +39,6 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
addTodoButton.addEventListener("click", function() {
|
addTodoButton.addEventListener("click", function() {
|
||||||
const todoText = newTodoInput.value.trim();
|
const todoText = newTodoInput.value.trim();
|
||||||
if (todoText !== "") {
|
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);
|
addTodoToList(todoText);
|
||||||
saveTodoList();
|
saveTodoList();
|
||||||
newTodoInput.value = "";
|
newTodoInput.value = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user