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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:38:18+00:00 2026-06-07T21:38:18+00:00

just having a little issue figuring this jquery problem out. I have a table

  • 0

just having a little issue figuring this jquery problem out. I have a table with some numbers show on each row. I want it to so that when I click on the number which is a href link it toggles the div called “test” which is initially hidden. Currently with my code when I click one row with the number, all rows toggle since they share the same class name. How do I solve this issue so that only the row that is clicked toggles instead?

Some additional information the table and content is dynamically generated.

My HTML

<table>
 <tr>
  <td>
    <a class="showinfo" href="#"><b>ID:12</b>Click me<b></a>
    <div class="test">Test</div>
  </td>
 </tr>
 <tr>
  <td>
    <a class="showinfo" href="#"><b>ID:46</b>Click me<b></a>
    <div class="test">Test</div>
  </td>
 </tr>
</table>

My JS is as follows

$('.test').hide();
$('.showinfo').click(function(){
    $('.test').toggle();    
});

Thank you.

  • 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-07T21:38:19+00:00Added an answer on June 7, 2026 at 9:38 pm

    Try this

    $('.showinfo').click(function(e){
        e.preventDefault();
        $(this).closest('td').find(".test").toggle();
    });
    

    DEMO.

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

Sidebar

Related Questions

Question says it all. I'm just having trouble figuring this out. What i'm trying
I'm just putting together a little POC project, and I'm having some weird issues
I've only just recent began learning C++ and am having a little issue with
I'm just learning core data and mostly coping, but having a little bit of
I am just starting to learn a little about PHP; having trouble with the
I'm just having an issue I'm hoping someone will be able to give me
well I think I know what the problem is. I am just having a
I've been having a little issue with image URLs. Usually I wouldn't care about
Having a strange issue with the TabContainer in the AJAX Toolkit. We have several
This problem is somewhat complicated and I'm in a little over my head. I

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.