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 trialHaardik Gupta
Full Stack JavaScript Techdegree Student 5,459 Pointsselectors in js
Please fill in the correct answer in each blank provided below.
Fill in the blank(s) below:
Consider the following HTML:
<nav> <ul> <li><a href="index.html">Portfolio</a></li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav>
Complete the JavaScript code below by writing a selector that targets all <a> elements inside the <nav> element:
var expectedLinks = document.querySelectorAll("");
Haardik Gupta
Full Stack JavaScript Techdegree Student 5,459 PointsYes what to put In the blank
Steven Parker
231,248 PointsI'm asking you: what answer did you try that did not work?
If you don't have any idea of what to put, you might want to review the video.
Haardik Gupta
Full Stack JavaScript Techdegree Student 5,459 Pointsthere aren't any videos for this section there were these reading things i reviewed them but am still confused i put var expectedLinks = document.querySelectorAll("a");
1 Answer
Tobias Graefe
11,934 PointsTry to make it more specific. It is asked for all anchor elements, that are nested in the nav element. So it should be the descendant selector "nav a".
Steven Parker
231,248 PointsSteven Parker
231,248 PointsSo what answer are you putting into the blank?