-
-
Notifications
You must be signed in to change notification settings - Fork 41
NW6 | Fikret Ellek | JS2 Module | [TECH ED] Build todo-list app | WEEK-4 #228
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for cute-gaufre-e4b4e5 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
for (const todo of todos) { | ||
const toDoListElement = document.createElement("li"); | ||
toDoListElement.innerText = todo.task; | ||
toDoListElement.classList.add(todo.task.replaceAll(" ", "-")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really handy way that every class name is one-of-a-kind :) Just keep in mind, if you add the same todo twice, it might behave differently
deleteBtn.innerText = "Delete"; | ||
deleteBtn.classList.add("todo-btn"); | ||
deleteBtn.classList.add("delete-btn"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code is well-structured and easy to understand @fikretellek . Great job!
span.appendChild(doneBtn); | ||
span.appendChild(deleteBtn); | ||
toDoListElement.appendChild(span); | ||
list.appendChild(toDoListElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome job here!!!! You'll learn much about DOM manipulation in the other modules, but you already follow the best practices, which is to prepare everything with JS and then add one thing to the DOM if possible. You absolutely smashed it.
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.