Merge pull request #32 from ecraig12345/day1

Day 1 updates
This commit is contained in:
Micah Godbolt
2019-02-27 18:15:10 -08:00
committed by GitHub
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;
}
}