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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:49:43+00:00 2026-05-18T02:49:43+00:00

<table> <tr><td> <div><img src=1.jpg>text<span class=get>aa</span> <span class=click>Get value</span></div></div></td></tr> <tr><td> <div><img src=2.jpg>text<span class=get>bb</span> <span class=click>Get

  • 0
<table>
    <tr><td>
        <div><img src="1.jpg">text<span class="get">aa</span> <span class="click">Get value</span></div></div></td></tr>
    <tr><td>
        <div><img src="2.jpg">text<span class="get">bb</span> <span class="click">Get value</span></div></td></tr>
    <tr><td><div><img src="1.jpg">text<span class="get">cc</span> <span class="click">Get value</span></div></div>
        </td></tr>
</table>

How do i get closest value of class get when class click is clicked?

$('.click').click(function() {
    $(this).each(function() {
        $('#sample').text($(document).closest('div').find('.get').text());
    });
});

this not working, it return empty..

Any idea why?

  • 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-18T02:49:44+00:00Added an answer on May 18, 2026 at 2:49 am
    $('.click').click(function() {
      $('#sample').text($(this).siblings('.get').text());
    });
    

    Here is working sample: http://jsfiddle.net/rcXka/

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

Sidebar

Related Questions

<div class=divorder> <table class=formfieldsmall> <tr> <td style=width: 2%;> <img class=trigger src=/SPLockerWebApp/Assets/themes/default/images/plus.png /> </td> </tr>
I'm trying to get a DIV element into a table cell, in a way
I'm implementing a table with a fixed header using this kind of setup: <div
I'm trying to implement something like this: <div> <table> <thead> <tr> <td>Port name</td> <td>Current
I have table inside a div tab. The table has 40 rows in it
Ever since switching from TABLE-layout to DIV-layout, one common problem remains: PROBLEM : you
I have a fixed width DIV containing a table with many columns, and need
How can i make the inner table to overlap the parent div with 5
I am trying to have a table header, in a seperate div stay in
<div> <h1>Title</h1> <table> ... </table> </div> Now, the <h1> has a margin: 0; so

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.