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
Peter Huang5,426 Points
how do you spot an HTML Collection?
Is it only when we see " collection[name] " ?
because everything we've been using are " getElementsByTagName " / " querySelector ", etc. Are these node list?
Im a little confused
Steven Parker224,811 Points
An HTMLCollection differs from a NodeList primarily in that it is "live", meaning that its contents will be automatically updated whenever the associated parts of the DOM are changed.
On the other hand, a NodeList is typically a static "snapshot" of how things were at the time it is created (though there are some "live" exceptions). A NodeList also has some additional methods not available on an HTMLCollection.
For more details, see these MDN pages on HTMLCollection and NodeList.