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 trialObe Juarez
6,357 PointsWhat am i doing wrong?
im not understanding if i have to select the first one and hide it as well? And i cant seem to target the first name... i thought it had the number #0?
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<h2>Student List</h2>
<ul class="student-list">
<li>James McAvoy</li>
<li>Alena Holligan</li>
<li>Wade Christensen</li>
<li>Matt Krzyzynski</li>
</ul>
<script src="jquery-3.2.1.min.js"></script>
<script src="app.js"></script>
</body>
</html>
$('li').eq(2).hide().prev(0).hide();
1 Answer
Steven Parker
231,261 PointsThe task 2 instructions say "You've just learned about the next() and prev() methods. Use one of them to traverse from Wade Christensen to James McAvoy in the list of students."
There's no mention of "hide" in the instructions, you only need to do the traversal. Also, the "prev" method does not take an argument (but you can chain more than one of them together).
Obe Juarez
6,357 PointsObe Juarez
6,357 PointsSteven Parker could you kindly write down the solution for this test please?
Steven Parker
231,261 PointsSteven Parker
231,261 PointsI'd feel better about helping you get it yourself, I think you'll have a better learning experience that way.
Give it a shot using the hints I've given you; and if you still have trouble, show your revised code and we can take it from there.
Obe Juarez
6,357 PointsObe Juarez
6,357 PointsThanx for not telling me the answer! lol . i figured it out . It was SO EASY im embarrassed lol.. Im doing JS course and this at the same time so doing both gave me some insight .
Steven Parker
231,261 PointsSteven Parker
231,261 PointsObe Juarez — Glad to help. You can mark a question solved by choosing a "best answer".
Happy coding!