- Get a reference to the span with the
remaining
class, and store it in a variable - Use querySelectorAll to get all of the todos.
- Set the
innerText
of the remaining span to the length of those todos. - Add updateRemaining() to addTodo
- Get a reference to all of the todos with querySelectorAll
- Use a
for (let todo of todos)
loop to iterate over each todo - Inside the for loop write an
if
statement to test if theinput
inside of the todo has a checked value of trueHint: you can use querySelector on any HTML node to find child elements within
- Call
todo.remove()
for any todo whos input check is true - After the loop is done, run
updateRemaining()
- Attach this function to the footer button
- Test it out!