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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:23:12+00:00 2026-05-26T03:23:12+00:00

In my index.php I have TABLE with four rows. One of them contains INPUT

  • 0

In my index.php I have TABLE with four rows. One of them contains INPUT class=”sipPacket” the next TEXT the next INPUT class=”sipPacket” the next TEXT. Every two rows are in the TBODY.

<table>
<tbody>
<tr><td><input class="sipPacket" type="radio" /></td></tr>
<tr><td>Some text 1...</td></tr>
</tbody>
<tbody>
<tr><td><input class="sipPacket" type="radio" /></td></tr>
<tr><td>Some text 2...</td></tr>
</tbody>
</table>

I just want that when I check one radio button the part behind the second ‘tr’ with text “Some text 2” in next ‘tbody’ was hidden and vice versa.
I did something like this:

$('.sipPacket')
.live('click',function() {
    if($(this).is(':checked')) {
       $(this).parent().parent().parent().addClass('on').fadeIn().siblings().removeClass('on').children('tr:odd').fadeOut();
    }
});

It hides the second element but does not show it again when I press the radio on this hidden element.

  • 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-26T03:23:12+00:00Added an answer on May 26, 2026 at 3:23 am

    I believe this will do what you’re trying to do (but I’m not 100% sure what you’re trying to achieve, and there may well be an easier way!):

    $(".sipPacket").click(function() {
        $(this).closest("tbody").children("tr:eq(1)").fadeIn().end()
            .siblings().children("tr:eq(1)").fadeOut();
    });
    

    Here’s a working example. It gets the ancestor tbody using closest (which, as noted in the comments on the question, is much easier than using parent().parent() etc.), then fades in the second tr child of that tbody. It then uses end to get back to the original matched set of elements (which happens to be the tbody), gets the siblings of that element (there is only one) and finally fades out the second tr child of that sibling.

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

Sidebar

Related Questions

I have following HTML table: <form method=post action=update-table.php> <table class=table-data style=width: 960px;> <thead> <tr>
This is for MySQL and PHP I have a table that contains the following
http://www.srcf.ucam.org/~sas98/ents/index.php I have a table called ents with a varchar(100) field called week containing
I have form with two buttons submit. The code is: <form action=index.php method=get> <table
In index.php I have a form and in the form a text field: <form
I have a page index.php where i have a link called add_users.php. In add_users.php,
Assume that I have 2 .php files : index.php and ajax.php This is index.php:
I have a PHP script (index.php) that includes an index.html file in a sub-directory
I have a template in joomla without index.php I only have index.html, css file,
I have 2 php files. index.php: <?php $counter = 0; require_once('temp.php'); temp(); echo $counter;

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.