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!
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
Jason Larkin
13,970 PointsTraversing and Manipulating the DOM with JavaScript Challenge 1 part 2
I am thoroughly stuck on question #2: making line 14 get the anchor element from inside the listItem. Everything I try, all based upon reviewing the preceding videos and Workspace notes results in an error message.
Can anybody please help put me on the right track?
2 Answers

Dustin Matlock
33,856 PointsHi Jason, the code challenge wants you to get the anchor — a element — from inside the listItem. You can do that using the querySelector, and here's how:
var anchor = listItem.querySelector("a");
Jason Larkin
13,970 PointsThank you Dustin, I hadn't tried that!