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

The Archive Base Latest Questions

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

I am trying to select a span within a span within a div using

  • 0

I am trying to select a span within a span within a div using plain CSS or JQuery selectors. The html is as follows:

<div id="example2_paginate" class="dataTables_paginate paging_full_numbers">
<span id="example2_first" class="first paginate_button paginate_button_disabled">First</span>
<span id="example2_previous" class="previous paginate_button paginate_button_disabled">Previous</span>
<span>
<span class="paginate_active">1</span>
<span class="paginate_button">2</span>
<span class="paginate_button">3</span>
<span class="paginate_button">4</span>
<span class="paginate_button">5</span>
</span>
<span id="example2_next" class="next paginate_button">Next</span>
<span id="example2_last" class="last paginate_button">Last</span>
</div>

I want to select spans that contain 1 to 5 (paginate_active and the 5 paginate buttons), individually.

With my very limited knowledge of CSS and jQuery I’ve tried a couple of things but I’m sure my syntax is wrong, like $("paging_full_numbers span:eq(1)") .

Could you please give me a hint of how to go about it?

  • 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-25T15:17:35+00:00Added an answer on May 25, 2026 at 3:17 pm

    To select them individually, you can simply select them all and then use jQuerys .each(). For example

    spanList = $('#example2_paginate').find('.paginate_active, .paginate_button');

    will find all classes of ‘paginate_active’ or ‘paginate_button’ that, are inside your element of id=example2_paginate. Then you can write:

     spanList.each(function(index){
        <-- code here for occurence of index index-->
    });
    

    Alternatively to select the i^th button without looping through them all:

    spanList.eq(i)
    

    See jsFiddle: http://jsfiddle.net/t4KWr/

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

Sidebar

Related Questions

I am trying to select a <div> using jquery's $('#divname') inside a infobox that
here is my HTML: <div class=foo> <span class=ignore_this>IGNORE THIS TEXT</span> SELECT THIS </div> I'm
I have a text string i'm trying to select the spans from using jQuery.
i'm trying to select the <a> within the <span> that's the nth child of
I'm trying to update/save dynamically created html objects using jquery. But in one particular
Trying to select anchor tags that are a descendants of a div with a
In trying to select elements that have any attributes, the following throws a jQuery
The Markup: <div class=day> <span>1</span> <div class=icon-shop icon-blank><p class=event-details id=shop-1></p></div> <div class=icon-eat icon-blank><p class=event-details
I've been using a bit of jquery in my asp.net project and are trying
I'm trying to dynamically create a form using JQuery. In order to do this,

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.