Bug Tracker


Ticket #13846 (closed bug: fixed)

Opened 12 months ago

Last modified 12 months ago

jQuery 2.0.0 reversing order of returned elements

Reported by: slubowsky Owned by:
Priority: undecided Milestone: 2.0.1
Component: traversing Version: 2.0.0
Keywords: Cc:
Blocking: Blocked by:


See  http://jsbin.com/oxisur/2/edit where jQuery 1.9.1 iterates through elements in expected order but jQuery 2.0.0 reverses them.

Sample code below as well:

<!DOCTYPE html>
    <div>Foo 1</div>
        foo 1 stuff
    <div>Foo 2</div>
        foo 2 stuff
    <div>Foo 3</div>
        foo 3 stuff
    <!--<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>-->
    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
        $(function () {
            $('body>blockquote').prev().each(function process(i, v) {
                console.log(i + ': ' + $(v).text());

Change History

comment:1 Changed 12 months ago by Richard Gibson

  • Status changed from new to closed
  • Resolution set to fixed

Fix #13846: .prev sort direction

Changeset: 9c4a428528cc47b0ef87a273f191c0fbbccc9678

comment:2 Changed 12 months ago by gibson042

  • Component changed from unfiled to traversing
  • Milestone changed from None to 2.0.1

Yeah, this was my mistake. Thanks for the report!

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


Add a comment

Modify Ticket

as closed

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.