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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:53:45+00:00 2026-05-24T02:53:45+00:00

I have 3 checkboxes and 2 divs. I want to be able to show

  • 0

I have 3 checkboxes and 2 divs. I want to be able to show one div when all 3 checkboxes have been ticked and show the other div when any other combination of checkboxes are ticked (ie not all 3).
It would be very much appreciated if anybody could help me out with some suggestions. Thanks in advance.

<input id="1" type="checkbox" />
<input id="2" type="checkbox" />
<input id="3" type="checkbox" />

<div id="checked1">Title</div>

<div id="checked2" style="display:none;"><span style="color:green;">Title</span></div>


$(document).ready(function() {

$(('input#1')&&('input#2')&&('input#3')).change(
    function() {
        if ($(this).is(':checked')) {
             $("#checked2").show();
             $("#checked1").hide();

        } else {
              $("#checked1").show();
             $("#checked2").hide();
            }
    });
});
  • 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-24T02:53:46+00:00Added an answer on May 24, 2026 at 2:53 am
    var $cBoxes = $('#1,#2,#3');
    
    $cBoxes.change(function(){
      // check if all are checked based on if the number of checkboxes total
      // is equal to the number of checkboxes checked
      if ($cBoxes.length == $cBoxes.filter(':checked').length){
        $('#checked2').show();
        $('#checked1').hide();
      }else{
        $('#checked2').hide();
        $('#checked1').show();
      }
    });
    

    Something like that?

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

Sidebar

Related Questions

I have a serie of checkboxes and I want to gather the selected one.
I have ten checkboxes and Enum. I want to bind this checkboxes to Enum.
I have two checkboxes. I need to check that at least one of them
I have this need to show and hide a div if a checkbox is
I have a FormView and I need to access some Divs and other controls
I have a script that works when i click all 3 checkboxes it shows/hides
I have a list of div's I want to filter with 2 groups of
I have a view where ill have 3 divs: Div 1: List of Brands
I have a popup div and want to hide it when users click outside
I have several checkboxes spread across two divs. The two divs are contained in

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.