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 trialQuintin Riley
12,136 PointsNeed a little help
On line 14 of the app.js, we want to get the anchor (the a element) from inside the listItem. Use a method to traverse and select the anchor.
2 Answers
Patrick Koch
40,498 PointsHello Quintin, The querySelector() will help ;-)
Exp. for your app.js if you write
var incompleteTasksHolder = document.getElementById("incomplete-tasks"); //incomplete-tasks
var selecta = incompleteTasksHolder.querySelector("label");
console.log(selecta);
the console shows you the select element, if you have more elements that fit to the enterd selectors, its just shows you the first, its pretty cool you can enter "a" for anchor or a class name like " .editMode". I personally really like the querySelector.
!!!! spoiling:
var anchor = listItem.querySelector("a");
Greetings Patrick
Hugo Paz
15,622 PointsSee if this method helps http://api.jquery.com/next/
Quintin Riley
12,136 Pointswill do thanks.
Bardhyl Bytyqi
14,558 PointsBardhyl Bytyqi
14,558 Pointswhat I have to do I this example. please help me.