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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:39:47+00:00 2026-06-12T08:39:47+00:00

I am trying to select <li> in groups of 3, currently I am using

  • 0

I am trying to select <li> in groups of 3, currently I am using :gt and :lt like this

 $('.events_list li:lt(7):gt(3)').css('display', 'block');

This is ok but seems like there may be a better way. I just want to click a button and select the next 3 <li>.

  • 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-06-12T08:39:48+00:00Added an answer on June 12, 2026 at 8:39 am

    Try

    var triplet = 0;
    
    $('button').click(function(){
        $('.events_list li')
            .hide() // hide the ones that are visible
            .filter(function(i){
                return i >= triplet*3 && i < (triplet+1)*3; // filter the next 3
            })
            .show(); // and show them
    
        triplet++;
    });
    

    demo at http://jsfiddle.net/PyEhU/

    • 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 only the topmost section H1s. In this fiddle ,
I am trying to select the last record from a table in MySQL using
I am trying to select an object from this array and print all of
I'm trying to select all dom elements that have id=mydiv but exclude the ones
I m trying to select rows/columns using vba. I want to pass row numbers
Currently using Telerik ASP .NET MVC Controls version 2011.2.712 Hello all, I am trying
Currently im trying to make my query short with reusable peice of code like
This should be really simple. I am using SSMS 2008, trying to get a
I'm trying to calculate churn using one mysql query... I can do this in
I have been trying to display a table of results for weekly sales using

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.