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 Challenge Task 3 of 3 : error Was expecting 2 images not 0

Why did this code not work: let footerImages= document.querySelectorAll("#footer img");

Steven Parker
Steven Parker
243,656 Points

Please provide a link to the course page you are working with.

1 Answer

You'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
Steven Parker
243,656 Points

How 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. :+1: