designerNProgrammer
designerNProgrammer

Reputation: 2701

grab all divs which does not have a class

I am trying to grab the div elements that do not have a specific class, called active.

So the code is:

 $(currentContainerDiv).addClass('active');

Now, the currentContainerDiv also has a class slidingDiv and now I want to grab all other other divs with the class of slidingDiv which don't have active attached.

How to achieve this?

I tried this but it didn't work:

   $('.slidingDiv').not(currentContainerDiv).removeClass('bottomed');

Upvotes: 0

Views: 43

Answers (1)

Vinita Rathore
Vinita Rathore

Reputation: 550

TRy this:

$('.slidingDiv:not(.active)').removeClass('bottomed');  

As you have stated "currentContainerDiv" also have class="slidingDiv". So no need to add filter for this.

Upvotes: 2

Related Questions