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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:37:12+00:00 2026-05-13T05:37:12+00:00

What I need to do is get the next element which isn’t of the

  • 0

What I need to do is get the next element which isn’t of the same type as the current. I’m not sure if that makes any sense. As far as I know, next() in jQuery only gets the next sibling.

This is what I have:

<tr>
   <td>
      <a>Link</a>
   </td>
</tr>
<tr>
   <td>
      <div class="A">
         <div class="B">...</div>
         <div class="B">...</div>
         <div class="B">...</div>
      </div>
   </td>
</tr>
<tr>
   <td>
      <a>Link</a>
   </td>
</tr>
<tr>
   <td>
      <div class="A">
         <div class="B">...</div>
         <div class="B">...</div>
         <div class="B">...</div>
      </div>
   </td>
</tr>

After clicking the link, I’d like to do something with the div.B’s within div.A. But only the first div.A right after the link, not the ones on the rest of the page. To be more specific, what I’m trying to do is set this up so that clicking the link will show or hide the div.B’s.

Is this possible or feasible? Will this being in a table be a problem?

I’m not a jQuery expert so I’m just kinda messing around with it right now.

  • 1 1 Answer
  • 4 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-13T05:37:12+00:00Added an answer on May 13, 2026 at 5:37 am

    This should do it for you. Will hide the div.B’s in the next div.A following the tag.

    $('a').click(function(){
        $(this).closest('tr').next().find('.A div.B').hide();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to know how I can get the first element that is visible
Ok, basically, I have an element that I get which happens to be a
I need get the id of an images which is place inside a datatemplate..
Need to get an div with overflow:hidden; not to wrap its children. I need
I need to get Current page Identifier and current module in Magento. I used
Previously I get an answer to the linking of an element. My next question
I need to use sprites as a background image for element type of <a>
I have a problem, I need to resolve type of class which replaced the
Just need get some vals located in application.ini(main ini) in the Controller plugin I
I need get all items these have no categories int? categoryId = null; var

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.