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

  • Home
  • SEARCH
  • 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 6631653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:34:35+00:00 2026-05-25T22:34:35+00:00

Markup code: <div id=elements> <div> <a href=#>text</a> <a href=#>text</a> <a href=#>text</a> </div> <div> <a

  • 0

Markup code:

<div id="elements">
    <div>
        <a href="#">text</a>
        <a href="#">text</a>
        <a href="#">text</a>
    </div>
    <div>
        <a href="#">text</a>
        <a href="#">text</a>
        <a href="#">text</a>
    </div>
    <div>
        <a href="#">text</a>
        <a href="#">text</a>
    </div>
</div>

Please tell me how can I get an array of all elements of the div, so that later, it is possible to address an array of options?

Such as:

divs[0]  
links[1] 
  • 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-25T22:34:36+00:00Added an answer on May 25, 2026 at 10:34 pm

    Demo

    var divs = $('#elements div');
    var links = $('#elements div a');
    
    1. If you want the DOM elements, then you can access them with the array style like divs[0] or links[2].
    2. If you want to get the specific jQuery object, you can access them with divs.eq(0) or links.eq(1).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Markup: <input type=text name=email /> Code: $(':text').focusout(function(){ $(this).validate(function(){ $(this).attr('name'); }); }); Plugin: (function($){ $.fn.validate
Consider the following code in VB9: Dim text = Line1<br/>Line2 Dim markup = <span><%=
All, this is my code //declare string pointer BSTR markup; //initialize markup to some
I have, for example, markup like this <div id=content> <p>Here is some wonderful text,
This code / markup... <ul id="tag-directory" class="clearfix"> <li py:for="tag in tags"><a href="${h.url_for(controller='/media', action='index', tag=tag.slug)}">${tag.name}</a>
I'm working on a jQuery hover code snippet that will add markup on hover
I placed all code below. My page works like that Page's first scene When
Markup works fine if I pull the code outside my app and test it,
I have the OnSendingMail event declared in the CreateUserWizard markup. I have the code
The markup below is used for my jQuery carousel widget. The first div serves

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.