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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:09:32+00:00 2026-06-13T07:09:32+00:00

Another jQuery thing for you that I’m scratching my head over. I have some

  • 0

Another jQuery thing for you that I’m scratching my head over.
I have some floated divs (shown below) that are turned on and off using jQuery.
I need to append some bits after every third child element that does not have a style of display:none.

<div class="ItemList">
    <div class="Item">A</div>
    <div class="Item" style="display:none;">B</div>
    <div class="Item">C</div>
    <div class="Item">D</div>
    <div class="Item" style="display:none;">E</div>
    <div class="Item">F</div>
    <div class="Item">G</div>
    <div class="Item">H</div>
    <div class="Item">I</div>
    <div class="Item" style="display:none;">J</div>
    <div class="Item">K</div>
    <div class="Item">L</div>
    <div class="Item">M</div>
    <div class="Item">N</div>
</div>

I have come up with this but it isn’t right!

$(".Item[style*='display: block']:nth-child(3n)").after("<div class='Clear'></div>");

Any ideas?!

  • 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-13T07:09:33+00:00Added an answer on June 13, 2026 at 7:09 am

    I’m not sure if you need the elements filtered before you select the .Item elements or after.

    After elements are selected.

    $(".Item:nth-child(3n)").filter(function(){
         return $(this).css("display") != "none";
    }).after("<div class='Clear'></div>");
    

    @undefined has a really good answer too.

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

Sidebar

Related Questions

I have website that use XMLHttpRequest (jQuery, actually). I also have another site running
Here's the thing, I have a jquery click event handler, that calls a post
Another jQuery question for you guys. Say I have a url of an image
I would like to know if I can include some Jquery inside another JQuery
I have a functionality in jquery-mobile in which I want to redirect to another
so that's a weird thing i'm working on. some of you already helped me
I have some Ajax that has been working on a live site, now it
JQuery events are annoying me. The thing is that I very often use javascript
Question 1 I've just started learning jQuery and one thing that puzzles me is
I have a jQuery plugin that calls a callback. I'm passing in an object

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.