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! While you're at it, check out some resources Treehouse students have shared here.

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

JavaScript JavaScript and the DOM Making Changes to the DOM Get and Set Content with textContent and innerHTML

Dohr Zerkavod
Dohr Zerkavod
7,808 Points

querySelector works but querySelectorAll doesnt...Why?

So at the end of the video Gil does this thing where he changes the ul elements using the querySelector on the ul element I figured the same thing would work if I used the querySelectorAll but it didnt change anything live does anyone have an idea why? is it bc Node lists arent live?

1 Answer

Bella Bradbury
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Bella Bradbury
Front End Web Development Techdegree Graduate 32,790 Points

Dohr,

querySelectorAll does in fact return a NodeList that is NOT live, hence why it wouldn't update live. However, it's important to note that some NodeLists are live! Take a look at this article about live/static NodeLists for some more information!