Day 1 updates

This commit is contained in:
Elizabeth Craig
2019-02-27 17:46:56 -08:00
parent 5e5717240c
commit 5aed397e01
14 changed files with 144 additions and 142 deletions

View File

@@ -65,7 +65,7 @@
function clearCompleted() {
const todos = document.querySelectorAll('.todo');
for (let todo of todos) {
if (todo.querySelector('input').checked == true) {
if (todo.querySelector('input').checked === true) {
todo.remove();
}
}
@@ -78,12 +78,12 @@
const filterName = button.innerText;
for (let todo of document.querySelectorAll('.todo')) {
const checked = todo.querySelector('input').checked == true;
if (filterName == 'all') {
const checked = todo.querySelector('input').checked === true;
if (filterName === 'all') {
todo.hidden = false;
} else if (filterName == 'active') {
} else if (filterName === 'active') {
todo.hidden = checked;
} else if (filterName == 'completed') {
} else if (filterName === 'completed') {
todo.hidden = !checked;
}
}