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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:52:13+00:00 2026-05-26T12:52:13+00:00

I am currently having a problem with multiple div’s toggling at the same time.

  • 0

I am currently having a problem with multiple div’s toggling at the same time.
I have these 4 div’s with the same class that I want to display, how do I do that?

<div id="container">
    <div class="box"><!-- box 1 -->
    <div class="link"><a href="#" class="show">show content</a></div>
    <div class="hidden">this text is hidden</div>
    </div><!--box ends-->

    <div class="box"><!-- box 2 -->
    <div class="link"><a href="#" class="show">show content</a></div>
    <div class="hidden">this text is hidden</div>
    </div><!--box ends-->

</div><!--container ends -->

I think you get the point. The problem is, this is comes from a php while, if the user haven’t contributed any content, then there wouldn’t be any div’s, and if he have, there will display div’s equal to all his contributions.

I have tried with

$(".show").click(function(){
$(".hidden").toggle();
});

but the above code shows all of them, so how do I show the one that was need to be shown ?
I hope you understand.

  • 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-26T12:52:13+00:00Added an answer on May 26, 2026 at 12:52 pm

    Use:

    $(".show").click(function(){
      $(this).parent().next(".hidden").toggle();
    });
    

    parent() gets you div.link and next() gets you div.hidden which would toggle.

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

Sidebar

Related Questions

I'm currently having the following problem: I've got a TableView that is given TableRow's
I'm currently building a multiple-document interface application, but I'm having a problem when the
I currently have multiple tables in my database which consist of the same 'basic
Currently, i have a declaration in a root class that iterates through the properties
I'm currently having a problem with a ShoppingCart for my customer. He wants to
I'm trying to build firefox but I'm having some problems. I currently have Visual
im currently having troubles on my codes in C#. I want to split strings
I am currently struggling with a query that needs to retrieve multiple records from
The issue I'm currently having is mapping multiple GUI fields to object properties (i.e.
Currently, I have an Excel spreadsheet with some data and a command button that

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.