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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:34:24+00:00 2026-05-23T08:34:24+00:00

I have a page with many elements that have the same class attached to

  • 0

I have a page with many elements that have the same class attached to them:

<div class="everyDiv"></div>
<div class="everyDiv"></div>
<div class="everyDiv"></div>
<div class="everyDiv"></div>
...

I add additional classes based on filters the user chooses to hide/display them:

<div class="everyDiv hide1"></div>
<div class="everyDiv hide2"></div>
<div class="everyDiv hide3"></div>
<div class="everyDiv hide2 hide3"></div>
...

Now, I need to select a range (using slice()) of the .everyDiv elements that DON’T have any of the “hide” classse – .hide1 .hide2 .hide3.

How can I do this with jQuery?

I’ve tried the following without success:

$("div.everyDiv").not(".hide1").not(".hide2").not(".hide3").slice(n1, n2);

$("div.everyDiv:not(.hide1):not(.hide2):not(.hide3)").slice(n1, n2);

This doesn’t work either:

$("div.everyDiv:not(.hide1), div.everyDiv:not(.hide2), div.everyDiv:not(.hide3)").slice(n1, n2);

Basically, all of the “hide#” classes have CSS of display: none;, so I need to select my specified range of the divs that aren’t “hidden”.

  • 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-23T08:34:25+00:00Added an answer on May 23, 2026 at 8:34 am

    this should do it:

    $('div.everyDiv:not(.hide1, .hide2, .hide3)').hide();
    

    http://jsfiddle.net/s9uyk/

    as per comments: making it a little more obvious what the fiddle is doing:
    not it adds a class to all the ones that DON’T Have any of the hide classes.
    http://jsfiddle.net/s9uyk/2/

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

Sidebar

Related Questions

I have a DIV with many elements that are all clickable. Each one with
how can i do. i have many html elements on page. after clicking on
I have a ASP.NET web page that contains many textboxes. Each textbox has a
Many applications have grids that display data from a database table one page at
I have many elements on page and all of which i want to translate
I have following function to add elements to the page on the fly; function
I have a container div that holds many child divs. One of the divs
I have a DOM element like this: <div id='master-value'>Apples</div> I have many other elements
I have a web page with many (up to 100+) html elements on it.
I have a page with many forms in panels and usercontrols, and a requiredfield

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.