Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript jQuery Basics Understanding jQuery Events and DOM Traversal DOM Traversal with jQuery

gladys padilla
gladys padilla
7,909 Points

Can someone please help?

I've tried so many ways to solve this and now I'm going crazy! I've tried: prev(), prev().prev(),prev('li') and nothing! Could someone please explain? Thanks!

<!DOCTYPE html>
<html lang="en">
  <h2>Student List</h2>

  <ul class="student-list">
    <li>James McAvoy</li>
    <li>Alena Holligan</li>
    <li>Wade Christensen</li>
    <li>Matt Krzyzynski</li>

  <script src="jquery-3.2.1.min.js"></script>
  <script src="app.js"></script>
$('li').eq(2).css('Wade Christensen');

2 Answers

Hi Gladys, it seems you were adding some extra code. To get to Wade, all you need to put is:


And when chaining, you would do the following:


I hope this helps!

gladys padilla
gladys padilla
7,909 Points

It worked! Thank you so much!!