Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7493371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:55:26+00:00 2026-05-29T16:55:26+00:00

Say, for example, I have a sortable list: <ul> <li>Item 1</li> <li>Item 2</li> <li>Item

  • 0

Say, for example, I have a sortable list:

<ul>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>

What I want to know is, if I make a jQuery call such as the following:

$.each($('li'), function(key, item) {...});

Can I expect jQuery to go through the entries from top to bottom? I’ve run a few tests, and tried rearranging items dynamically using jQueryUI, and so far, it seems to always run in order. But can this always be expected? Or is it dumb luck that I’ve not run into anything so far to make me think otherwise…?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T16:55:36+00:00Added an answer on May 29, 2026 at 4:55 pm

    “Can I expect jQuery to go through the entries from top to bottom?”

    Yes. They are iterated by numeric index from 0 to length - 1.

    The elements will always be returned in the order that they appear in the DOM.

    “I’ve run a few tests, and tried rearranging items dynamically…”

    It doesn’t give consideration to CSS positioning if that’s what you mean. If you’re changing their actual location in the DOM, then you’d only see the updates if you re-select them from the DOM.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say for example I have the following string: var testString = Hello, world; And
Let's say for example i have URL containing the following percent encoded character :
For example: I have an implementation (say doSomething()) in Base class. I want all
Say for example, I have the following two tables: TableA { _id } TableB
I have a list of items lets say for example a, b, c. As
Lets say for example I have the following 2 vectors: *B *A The vector
Say for example I have a body with the class test and I want
Say for example I have the following type: public class Site { public string
Say for example I have a Blog app that I want to be able
Say for example I have the following code: <h3>My very long title</h3> <h3>Another long

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.