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

  • Home
  • SEARCH
  • 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 892909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:08:09+00:00 2026-05-15T14:08:09+00:00

Should work same as it’s working independently. This (function($) { $(document).ready(function(){ $(‘#number1’).hide(); $(‘.button1’).click(function(){ $(‘.table1’).slideToggle();

  • 0

Should work same as it’s working independently.

This

(function($) { 
     $(document).ready(function(){
          $('#number1').hide();
        $('.button1').click(function(){
              $('.table1').slideToggle();
        $(this).toggleClass("minus_icon"); 
                return false;
   });
});

})(jQuery);

and this

(function($) { 
     $(document).ready(function(){
          $('#number2').hide();
        $('.button2').click(function(){
              $('.table2').slideToggle();
        $(this).toggleClass("minus_icon"); 
                return false;
   });
});

})(jQuery);

both will be used on same page.

Thanks

Edit: Added after @Felix comment

@Felix – Do you mean like this?

(function($) { 
     $(document).ready(function(){
          $('#number2, #number1').hide();
        $('.button2').click(function(){
              $('.table2').slideToggle();
        $(this).toggleClass("minus_icon"); 
                return false;
   });
});
        $('.button1').click(function(){
              $('.table1').slideToggle();
        $(this).toggleClass("minus_icon");
                return false;
   });
})(jQuery);
  • 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-15T14:08:09+00:00Added an answer on May 15, 2026 at 2:08 pm

    A sample HTML

    <button id="button1" class="btn" div="table1">Table 1</button>
    <button id="button2" class="btn" div="table2">Table 2</button>
    <div class="myDiv" id="div1"><table><tr><td>Table1</td></tr></table></div>
    <div class="myDiv" id="div2"><table><tr><td>Table2</td></tr></table></div>
    

    CSS

      .myDiv { display:none; }
    

    Jquery

     $(document).ready(function(){
    
        $('.btn').click(function(){
            //identify same class to all your div for example in this case I will define all tables as myDiv
            // doing this will not fix the effect to just two tables
            $(".myDiv").slideUp(); //Hide all divs first
    
            $('#'+$(this).attr("div")).slideToggle(); //show the required
            $(this).toggleClass("minus_icon");
            return false;
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 506k
  • Answers 506k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Unfortunately, this analysis on the DB side isn't really going… May 16, 2026 at 3:47 pm
  • Editorial Team
    Editorial Team added an answer You can setup two different cells for even/uneven rows like… May 16, 2026 at 3:47 pm
  • Editorial Team
    Editorial Team added an answer Partials are just another view scripts. My advice is: newer… May 16, 2026 at 3:47 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

the code is below, I am trying to call the RATE function. RATE(120, -271.09,
There are many ways to do this but I feel like I've missed a
I have 4 persistent classes which all have the same fields (exactly) the only
This is a rather elementary C# question; my apologies, but I haven't been able
I'm trying to learn descriptors, and I'm confused by objects behaviour - in the
How can I find what languages have been loaded into EnterpriseDB(PL/pgsql, SPL, Java)? EnterpriseDB
I have problems with moving files in directories in Java. The problem is that
I have just tried adding a WebService (asmx based) from a WebForms project to
I'm stumped. A client and I are both running Firefox 3.0.12 on XP machines.
I am trying to detect when a user has finished scrolling a web page

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.