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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:07:59+00:00 2026-06-09T19:07:59+00:00

I have this code that I can’t modify, and I want to add a

  • 0

I have this code that I can’t modify, and I want to add a selector that selects (on click) all the elements under it, till the next appearance of the main element. The problem is they are not nested, just one under other.

<div class="project name">..</div>
<div data-project-id="1987" class="sidebar_project">...</div>
<div data-project-id="3087" class="sidebar_project">...</div>
<div data-project-id="8903" class="sidebar_project">...</div>
<div data-project-id="223570" class="sidebar_project">...</div> 
<div class="project name">..</div>
<div data-project-id="1846" class="sidebar_project">...</div>
<div data-project-id="0935" class="sidebar_project">...</div>
<div data-project-id="84735" class="sidebar_project">...</div> 
<div class="project name">..</div>
<div data-project-id="11135" class="sidebar_project">...</div> 

I can easy select all sidebar_projects and hide them, but what I want its be able to make a button that on click hides/shows all sidebar_projects from It’s project name div to the next project name div.

THx

  • 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-09T19:08:01+00:00Added an answer on June 9, 2026 at 7:08 pm

    Try this:

    $('.project.name').on('click', function(e){
        $(this).nextUntil('.project.name', '.sidebar_project').toggle();
    });
    

    I didn’t test this, but I think that this will be work fine for you.

    More about nextUntil() see here

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

Sidebar

Related Questions

I have this code that doesn't work, can you help me? I want that
Challenge: I have this code that fails to compile. Can you figure out what's
I have this unsafe code that I need to make safe so it can
I encountered something that I can't understand. I have this code: cout << f1
I have this code that I want to make point-free; (\k t -> chr
i have this code that can do fast search on database. it works excellent
I have this code that sends just one attachment by time, how can I
I have this code: filenames=[file1,FILE2,file3,fiLe4] def alignfilenames(): #build a string that can be used
I have this code that can't send a Facebook request until now. NSDictionary *firstDict
I have this line of code that can throw null exceptions. singleAddress.FullAddress = cc.MailingAddressStreet1.ToString()

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.