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 trialvihar jakkam
1,270 PointsOn line 3 of app.js, select all images in the footer element and assign them to footerImages.
expecting 2 images not 0 is showing everytime
let navigationLinks = document.querySelectorAll("nav a");
let galleryLinks = document.querySelectorAll("#gallery a");
let footerImages = document.getElementsByClassName(".social-icon");
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Nick Pettit | Designer</title>
<link rel="stylesheet" href="css/normalize.css">
<link href='http://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/responsive.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<header>
<a href="index.html" id="logo">
<h1>Nick Pettit</h1>
<h2>Designer</h2>
</a>
<nav>
<ul>
<li><a href="index.html" class="selected">Portfolio</a></li>
<li><a href="about.html">About</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
</header>
<div id="wrapper">
<section>
<ul id="gallery">
<li>
<a href="img/numbers-01.jpg">
<img src="img/numbers-01.jpg" alt="">
<p>Experimentation with color and texture.</p>
</a>
</li>
<li>
<a href="img/numbers-02.jpg">
<img src="img/numbers-02.jpg" alt="">
<p>Playing with blending modes in Photoshop.</p>
</a>
</li>
</ul>
</section>
<footer>
<a href="http://twitter.com/nickrp"><img src="img/twitter-wrap.png" alt="Twitter Logo" class="social-icon"></a>
<a href="http://facebook.com/nickpettit"><img src="img/facebook-wrap.png" alt="Facebook Logo" class="social-icon"></a>
<p>© 2016 Nick Pettit.</p>
</footer>
</div>
<script src="js/app.js"></script>
</body>
</html>
13 Answers
MARTIN CLASON
Full Stack JavaScript Techdegree Graduate 19,730 PointsJust a comment... The videos did a very poor job of preparing us for this quiz. Very frustrating to need to use methods not taught in the videos to solve the quiz.
Rashika R
17,094 Pointslet footerImages = document.querySelectorAll(".social-icon");
Steven Parker
231,248 PointsWhen using getElementsByClassName, the argument should not have a period.
That's a convention often used to distinguish class names from other identifiers, but in this case the argument will always be a class name so it is not used.
JOASH MOARDEN
Courses Plus Student 587 PointsThis quiz should really be improved upon. All the quizzes so far followed the content of the videos prior whereas this one just seemed like it was full of curveballs. Initially the questions seemed simple enough, then after desperately combining all the combos I could think of I had to get my google on. This happened on each question and the solutions I found were not even mentioned in the video.
I got a lot of love for treehouse but this quiz is not up to par and could be very counter-productive to any learners with confidence issues etc.
However, if this is just a sneaky ploy to help us further our skills in the furtive art of Google-Fu then I will bow my head in deference.
Tom Dakan
3,967 PointsThe prompt asks you return all of the image objects in the footer. So let footerImages = document.querySelectorAll('footer img'); does exactly that.
Noe Tim
1,597 Pointslet footerImages = document.querySelectorAll('footer img'); how can it be this ^ when there is a p and a element too
I thought it would go something like this: let footerImages = document.querySelectorAll('footer img a p');
Tom Dakan
3,967 PointsWell, the prompt is to select the images. So there's no need to select the paragraphs (p) or anchors/links (a).
Why did you think you needed the 'a' and the 'p'? I'm not judging, just hoping I can help clear something up for you.
Nickolas Fuentes
14,016 Pointscan someone explain why
let footerImages = document.querySelectorAll('footer img');
worked as well??
Van Young
15,136 PointsYeah Why??? And why did task 2 need a '#'?
Van Young
15,136 PointsIt wouldn’t work otherwise and I had look at what someone else did. I’m still not sure why it needs that
Tom Dakan
3,967 PointsThe hash (#) specifies to select elements by their ID's
The dot (.) specifies to select elements by their classname
You can read more about the selectors here: http://api.jquery.com/category/selectors/basic-css-selectors/
darrin allen
7,775 Pointsyou would not need to use a # sign because footer is not an id document.querySelectorAll(#footer img); would be incorrect.
Omar Ocampo
3,166 Pointslet footerImages = document.getElementsByClassName("social-icon");
Just in case for another students with the same issue, this code worked for me, hope is useful
Tim Degerman
Full Stack JavaScript Techdegree Student 12,164 PointsThis worked for me.
Selecting the images with a class of 'social-icon' inside of the "footer"-element. let footerImages = document.querySelectorAll("footer .social-icon");
Bethany Wallace
3,833 PointsQuiz definitely needs to be improved.
Ng Yan Xiang
4,764 PointsWhy doesn't this code work:
let footerImages = document.querySelectorAll("footer > img");
while this would:
let footerImages = document.querySelectorAll("footer img");
Randell Purington
9,992 PointsRandell Purington
9,992 PointsI agree. It touched on some here and some there but it was vague on this test. I am beyond lost so I used the MDN but it helped only a little but looking at the correct answer plus the MDN I was able to take notes.
But I do agree, there are sections that make me question if I skipped a video or did I zone out because I don't remember them covering it.
alexfishback
Full Stack JavaScript Techdegree Student 2,468 Pointsalexfishback
Full Stack JavaScript Techdegree Student 2,468 PointsI am glad I'm not the only one.
Syed Ishmam
7,367 PointsSyed Ishmam
7,367 PointsAgreed
Asher Tormanen
4,714 PointsAsher Tormanen
4,714 PointsAgreed!
Matthew McQuain
14,184 PointsMatthew McQuain
14,184 PointsComing in a year later, and it's still the same. Totally garbage lead up to take this quiz. Much, much worse than anything else I've done here.
Siddharth Pandey
7,280 PointsSiddharth Pandey
7,280 PointsYes for sure, was this challenge even taught in the videos?
JOASH MOARDEN
Courses Plus Student 587 PointsJOASH MOARDEN
Courses Plus Student 587 Points++
Christopher Brown
4,843 PointsChristopher Brown
4,843 PointsThank you! I find that this happens more than one would appreciate. I understand the value in learning to research new information to pass a challenge, it can lead to a good skills in the working world, but sometimes we are missing so much info to do a challenge it is infuriating. It helps to know that I'm not alone in this frustration. Peace!
Christopher Brown
4,843 PointsChristopher Brown
4,843 PointsCompletely agree. Every once and a while this occurs, sometimes to the point of extreme frustration. I'm glad to research on the web on how to do certain things(I understand that is part of the skill set we are building), but there is often some sort of disconnect between the lessons and the challenges. It does not feel good to spend so much time on a challenge to then just have to look up an answer instead of using what you just learned. I'd rather study hard, take lots of notes and then feel as if I could actually accomplish something in the challenge as opposed to kind of feeling as if I've been mislead.