From e7fb20433fba06dc570dd3362f87c40d1103bbc3 Mon Sep 17 00:00:00 2001 From: Ronald Martin Date: Fri, 1 Mar 2019 08:57:02 -0800 Subject: [PATCH] Update Step 1-0 exercise to match instructions --- step1-03/demo/README.md | 3 +-- step1-03/exercise/README.md | 2 +- step1-03/exercise/index.html | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/step1-03/demo/README.md b/step1-03/demo/README.md index d10254a..b98e467 100644 --- a/step1-03/demo/README.md +++ b/step1-03/demo/README.md @@ -74,13 +74,12 @@ function addTodo() { ### Cleanup -Now that our todo has been inserted into the DOM, we can clear the text input and call `updateRemaining()`. +Now that our todo has been inserted into the DOM, we can clear the text input. In the exercise, we'll also update the count of the remaining todos in the footer from here. ```js function addTodo() { ... clearInput('.textfield'); - updateRemaining(); } ``` diff --git a/step1-03/exercise/README.md b/step1-03/exercise/README.md index b02cdb7..3b66acd 100644 --- a/step1-03/exercise/README.md +++ b/step1-03/exercise/README.md @@ -7,7 +7,7 @@ If you don't already have the app running, start it with `npm run static` from t 1. Add an `onclick` attribute to all three buttons in the navigation. 2. In each `onclick` call the `filter` function. In our function we need a reference to the clicked button, so pass in the keyword `this` as the only parameter. -### Write an `updateRemaining` function +### Complete the `updateRemaining` function 1. Get a reference to the span with the `remaining` class, and store it in a variable. 2. Use [`querySelectorAll`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll) to get all of the todos. diff --git a/step1-03/exercise/index.html b/step1-03/exercise/index.html index aaee51a..7daf894 100644 --- a/step1-03/exercise/index.html +++ b/step1-03/exercise/index.html @@ -47,9 +47,6 @@ } function updateRemaining() { - const remaining = document.querySelector('.remaining'); - const todos = document.querySelectorAll('.todo').length; - remaining.innerText = todos; } function addTodo() { @@ -59,7 +56,6 @@ todo.parentElement.insertBefore(newTodo, todo); clearInput('.textfield'); - updateRemaining(); } // clearCompleted