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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:48:45+00:00 2026-05-26T15:48:45+00:00

My question is: how do I make array of specific items within a pager

  • 0

My question is: how do I make array of specific items within a pager and select specific class
This is my next/previous (pager) html code:

<div class="item-list">
<ul class="pager" style="display: none;">
<li class="pager-current">1</li>
<li class="pager-item">
<a class="active" title="Go to page 1" href="/challenges?page=1">2</a>
</li>
<li class="pager-next">
<a class="active" title="Go to next page" href="/challenges?page=2">next ›</a>
</li>
<li class="pager-last">
<a class="active" title="Go to last page" href="/challenges?page=3">last »</a>
</li>
</ul>
</div>

A pager looks like this: <— previous 1 2 3 next —> where you can go to next page.

I want to loop thru all pages 1 – 100.

Select each page, get the content and make a array of all elements with <div class="items"> but only only the ones that has a class included named <div id="allowed"></div>

The page content:

<div class="wrapper">
  <div class="items">
    <div class="title"></div>
    <div class="body"></div>
    <div class="link"></div>
    <div class="allowed"></div>
  </div>
</div>
 <div class="wrapper">
  <div class="items">
    <div class="title"></div>
    <div class="body"></div>
    <div class="link"></div>

  </div>
</div>

Now is the element with the allowed class only be inserted into the array, and the other one ignored.

  • 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-26T15:48:46+00:00Added an answer on May 26, 2026 at 3:48 pm

    This is how you make an array with the items that have a child which contains an element which has the class allowed. Is this what you were looking for?

    var $items = $("div.items");
    var yourArray;
    
    $.each($items,function(){
       if($(this).children(".allowed").length){
           yourArray.push($(this));
       }  
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Extending a previous question about JavaScript and jQuery, I'm trying to make an array
This question might make one smile, really, HDD space is as cheap as dirt
This might be a really stupid question and make you guys laugh. I've deployed
Follow up to this question about GNU make : I've got a directory, flac
This question is related to How to make consistent dll binaries across VS versions
This question is about Why does autoboxing make some calls ambiguous in Java? But
(This question is related to my previous question , or rather to my answer
EDIT: Optimization results at end of this question! hi, i have a following code
This is a very general question that's not related to a specific language. I'm
I have two questions: 1) How can I make an array which points to

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.