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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:09:38+00:00 2026-06-14T21:09:38+00:00

I have the basic html structure: <table> <tbody> <tr class=1> <td> <p style=font-size:large> <span

  • 0

I have the basic html structure:

<table>

  <tbody>
    <tr class="1">
      <td>
        <p style="font-size:large"> 
            <span class="muted"> This is the first object </span> 
        </p>
      </td>
    </tr>

    <tr class="2">
      <td>
        <p style="font-size:large"> 
            <span class="muted"> This is second object </span> 
        </p>
      </td>
    </tr>

    <tr class="3">
        <p style="font-size:large"> 
            <span class="muted"> this is the third object </span> 
        </p>
      </td>
    </tr>

</tbody>
</table>

and then I have check boxes, the functionality i want is,
if checkbox 1 is checked, only the tr with class 1 be displayed.

if checkbox 2 and 3 are clicked, the tr with class 1 gets hidden and 2, 3 show in the dom.

again if checkbox 2,*3* are unchecked and 1 is checked tr with class 2, 3 do not show and 1 is showed.

How can this be done in 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-06-14T21:09:39+00:00Added an answer on June 14, 2026 at 9:09 pm

    Here’s a solution using radios, since explanation seems to indicate you want a choice of either 2&3 or 1 to show. Radios cancel each other whereas checkboxes don’t.

    If this is not behavior wanted you need to clarify your explanation

    HTML:

    <label>Show All<input type="radio" value="0" name="radio"></label>
    <label>1<input type="radio" value="1" name="radio"></label>
     <label>2 &amp; 3<input type="radio" value="23" name="radio"></label>
    

    JS

    var rows = $('tr');
    
    $(':radio').change(function() {
        var classNum = $(this).val();
        rows.hide();
        var toShow;
        if( classNum=='0'){
           toShow=rows;        
        }else{
            toShow = classNum=='1' ? rows.filter('.1') :  rows.not('.1');
        }
        toShow.show();
    });
    

    DEMO: http://jsfiddle.net/wGLfX/

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

Sidebar

Related Questions

I have this basic HTML structure: <fieldset> <input/> <label></label> <div class=toggle_box> <div class=switch></div> </div>
i have this basic html structure: <div class=a> <div class=m></div> <div class=m></div> </div> <div
I have some html with the basic structure <nav> <div> <a href=> <div class=navlink
I have this basic HTML structure: <div id=left-column></div> <div id=content></div> <div id=right-column></div> And this
This is probably a basic html/css question... I have a simple one-button form that
I have a basic string with holds a html table. The table looks like
I have a js.erb with this basic content: $(#currencies).html(<%= options_for_select([['Dollar', '$']])%>); And the html
So I have this basic html form. My goal is to pass the values
Sorry about the wording for my question title. I have a basic HTML anchor
I have just a basic html form within index.php which contains two text fields:

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.