Skip to main content

Bug Tracker

Side navigation

#6178 closed bug (wontfix)

Opened February 25, 2010 10:43PM UTC

Closed February 26, 2010 05:38PM UTC

Last modified January 27, 2011 10:07PM UTC

.parents() reverses element order

Reported by: RF Owned by:
Priority: Milestone: 1.4.2
Component: traversing Version: 1.4.1
Keywords: Cc:
Blocked by: Blocking:

Since jQuery 1.4, the parents() function reverses the order of the elements.


<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script language="JavaScript">
	$("div span").parents("div").each( function() {
		alert( $(this).text() );
	} );
Attachments (0)
Change History (2)

Changed February 26, 2010 05:38PM UTC by john comment:1

resolution: → wontfix
status: newclosed

Yep, this is intended - as with prevAll and prevUntil. Having them be reversed makes it much easier to access the intended value (for example, doing .parents(":first") will be equivalent to .parent()).

Changed January 27, 2011 10:07PM UTC by jitter comment:2

#5994 is a duplicate of this ticket.