Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ filterOption.addEventListener('click', filterTodo);
function addTodo(event) {
// preventing form button from submitting
event.preventDefault();


// removes the first character while it's a space
while (todoInput.value[0] == ' ') {
todoInput.value = todoInput.value.slice(1);
}

/// saving the new todo item in the todo file
// saving it in a local-storage
// saveLocalTodos(todoInput.value);
Expand Down Expand Up @@ -226,4 +231,4 @@ function removeLocalTodos(todo) {
// after deleting the todo-item, here we need to
// update the localStorage
localStorage.setItem('todos', JSON.stringify(todos));
}
}