mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
simplified the filter function in step 3, updated instructions to add it to the buttons. fixes #23
This commit is contained in:
@@ -46,9 +46,11 @@
|
||||
return document.querySelector('.textfield').value;
|
||||
}
|
||||
|
||||
function filter(filterName, button) {
|
||||
function filter(button) {
|
||||
document.querySelector('.selected').classList.remove('selected');
|
||||
button.classList.add('selected');
|
||||
|
||||
const filterName = button.innerText;
|
||||
for (let todo of document.querySelectorAll('.todo')) {
|
||||
const checked = todo.querySelector('input').checked == true;
|
||||
if (filterName == 'all') {
|
||||
|
||||
Reference in New Issue
Block a user