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

traversal challenge

Challenge Task 2 of 2 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.

Bummer: Did you make a call to the "prev" method after calling the "eq" method on the jQuery with a selector of "li"?
index.html app.js $('li').eq(2); $('li').eq(2).prev().prev();

how is this not working am now confused. may someone help me out plis.

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

1 Answer

Steven Parker
Steven Parker
194,132 Points

You've got the right thing, but this is one of the rare challenges that is asking you to change the task 1 code instead of adding another line.