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 triallaylazhang
5,111 PointsDoes this exercise want me to select all the link elements or all the list elements within the nav element?
Does the exercise want me to select all the a element within the nav element or all the list elements? I feel like I skipped a video or something but I didn't! Did the teacher mention anything about selecting child elements in the video beside turning even/odd rows to grey? So confused.
// this is what the video used to select even row, but here it raised a syntax error
let navigationLinks = document.querySelectorAll('nav:a');
1 Answer
Dean Paterson
12,996 PointsIt's asking for you to get all the links (a tags) inside the <nav> element nav:a isn't correct syntax... nav a:hover, nav a:odd etc is correct. To get 'a' inside 'nav' use 'nav a'
let navigationLinks = document.querySelectorAll('nav a');
Hope this helps