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 913101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:29:54+00:00 2026-05-15T17:29:54+00:00

Basically, is there a way to ‘cycle’ through child elements. i.e.: <ul> <li>some text</li>

  • 0

Basically, is there a way to ‘cycle’ through child elements.

i.e.:

<ul>
<li>some text</li>
<li>some more text</li>
<li>even more text</li>
</ul>

I want to get the text from the first <li>, perform a few operations, then move on to the next one and next one until I have gone through all of the child elements.

Is this possible?

  • 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-15T17:29:55+00:00Added an answer on May 15, 2026 at 5:29 pm

    Your question could use a little more explanation, but jQuery’s .each() is what I think you are looking for. Not to by confused with jQuery.each, which you can use to iterate over any collection, .each iterates over all of the elements that are within the jQuery object created from your selector expression. It executes a callback function for each element that is part of the jQuery object. The callback function is passed the index of the element and the element itself. It’s important to note that the callback is fired in the context of the current DOM element, so this refers to the element, and is not a jQuery object. So you could do something like:

    $("selectorForListElem").children().each(function(index, currentElem) {
        // processing for current child element
    });
    

    I’ve created a very simple example over on jsFiddle.

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

Sidebar

Related Questions

Is there an easy (therefore quick) way to accomplish this? Basically just take some
Is there a way to apply a single view model to several elements? Basically
Is there a way that I can trace every method, basically a line trace,
so basically like the title says is there a way to use NSSortDescriptor to
I basically need to check if there is an easier way to do this
I just want to design this very simple website. Basically there are multiple pages
I have some localization problems in my webpage. There are basically two problems (that
Basically there is a file called 8puzzle.py and I want to import the file
Slickgrid's column formatters return html to the grid object, so basically there's no way
Ok, basically there is a large C++ project (Recast) that I want to wrap

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.