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
mjmj
18,664 PointsJavaScript and the DOM Challenge Task 3 of 3 : error Was expecting 2 images not 0
Why did this code not work: let footerImages= document.querySelectorAll("#footer img");
Stephan Olsen
6,650 PointsSteven Parker I believe this is the challenge hes refering to: https://teamtreehouse.com/library/javascript-and-the-dom-2/getting-a-handle-on-the-dom/practice-selecting-elements
1 Answer
Stephan Olsen
6,650 PointsYou're selecting the footer by an Id named footer. The footer in the example has no Id, which is why it returns 0. Furthermore the images in the footer are nested in an a tag, which is not in your selector either.
Steven Parker
243,656 PointsHow did you spot that? Did you just happen to take that course yourself?
But good call, he just has an ID selector instead of an element (tag) selector.
Steven Parker
243,656 PointsSteven Parker
243,656 PointsPlease provide a link to the course page you are working with.