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

The Archive Base Latest Questions

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

I need help with a situation. I have a situation where i need a

  • 0

I need help with a situation.

I have a situation where i need a master checkbox to check/uncheck all the other checkboxes.
Each checkbox has an .hide class associated so when i UNCHECk each checkbox, this will hide each associated content div.

Then if i uncheck for example one of the checkboxes, the master one has to be unchecked.

I have created an example what i need here – https://dl.dropbox.com/u/23044665/teste.html

Can anyone help me with this?

Thanks a lot in advance

My code is:

jQuery

$(document).ready(function(){

    $("#overlay-1").change(function() {
        $(".overlay-1").toggleClass("hide", this.unchecked)
    }).change();

    $("#overlay-2").change(function() {
        $(".overlay-2").toggleClass("hide", this.unchecked)
    }).change();

    $("#overlay-3").change(function() {
        $(".overlay-3").toggleClass("hide", this.unchecked)
    }).change();

});

CSS

   .hide {display:none;}
   .overlay-1 {background-color:#333; color:#FFF;}
   .overlay-2 {background-color:#666; color:#FFF;}
   .overlay-3 {background-color:#999; color:#FFF;}
   .overlay-1, .overlay-2, .overlay-3 { padding:20px; margin-top:20px;}

HTML

    <div id="nav">
        <input type="checkbox" class="all" id="all" checked="checked"/> Check/Uncheck all<br />
        <input type="checkbox" name="overlay-1" id="overlay-1" checked="checked"> Overlay 1 <br/>
        <input type="checkbox" name="overlay-2" id="overlay-2" checked="checked"> Overlay 2 <br/>
        <input type="checkbox" name="overlay-3" id="overlay-3" checked="checked"> Overlay 3 <br/>
    </div>

    <div class="overlay-1">Overlay 1 Content</div>
    <div class="overlay-2">Overlay 2 Content</div>
    <div class="overlay-3">Overlay 3 Content</div>
  • 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-13T15:32:29+00:00Added an answer on June 13, 2026 at 3:32 pm

    Try this demo http://jsfiddle.net/fzMLr/ or your version like this: http://jsfiddle.net/p6hFD/

    Updated: http://jsfiddle.net/KXcWv/3/

    Rest should help :)

    My old response here: checkbox check all option

    Code

    $('input[name="hulk"]').click(function(){
    
              $(this).nextAll('input[name="'+this.name+'Sub"]').prop('checked',this.checked);
    
    });
    ​
    

    Sample

       $(document).ready(function() {
        $hulk = $("#overlay-1,#overlay-2,#overlay-3");
        $hulk.change(function() {
            $("." + this.id).toggleClass("hide", !this.checked);
            if ($('.test:checked').length == $hulk.length) 
                $('.all').prop('checked', true);
            else $('.all').prop('checked', false);
    
        });
    
        $('.all').click(function() {
            $(this).nextAll('input[type=checkbox]').prop('checked', this.checked);
            $hulk.trigger('change');
        });
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing a situation and need help. I have two tables: user: user_id
I need help with C programming. I have the following situation: struct Product {
I need help with following situation. I have widget with configure activity. In the
I need help writing a conditional where clause. here is my situation: I have
I need some help here. Here is my situation: I have a binding list
I have a puzzling situation I need some help with here please. I am
I have this diagram which should explain my situation I need some help on
I need help with this situation: I have activity, what starts IntentService. Service do
I've the following situation and need help (HTML/CSS/JS related) I have a div with
I need help on encryption/decryption on Android application. I explain the situation. I'm actually

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.