Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Greg Schudel
4,090 PointsWhy just the list 'property' instead of the 'children' property?
In this snippet of code we see the children
property used. Why not just use the 'list' or index '[i]' property?
filterCheckBox.addEventListener('change', (e)=> {
const isChecked = e.target.checked;
const lis = ul.children;
if (isChecked){
for (let i=0; i < lis.length; i += 1) {
let li = lis[i];
if (li.className === 'responded'){
li.style.display = '';
}else {
li.style.display = 'none';
}
}
} else {
for (let i=0; i < lis.length; i += 1) {
let li = lis[i];
li.style.display = '';
}
}
});
1 Answer

Steven Parker
225,664 PointsThe list (ul) itself is just a single element, so you would not be able to use an index with it. But the children refer to a collection (of list items) which can be indexed. You can see an example of that just a few lines later.
As to your other question, I'm not familiar with any property named "list".