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 trial

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!!