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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:10:21+00:00 2026-06-07T06:10:21+00:00

I am developing an invoice program and I am trying to select a single

  • 0

I am developing an invoice program and I am trying to select a single row using jquery but I Couldn’t exactly figure out how to select a row and extract its contents below is my code ! please advice

NOTE : I just added two rows but there will be more than 100 rows so i think its impossible to assign id’s for each td and call it using that id

 <table class="ProductSearch">
      <tr>
        <td>ID</td>
        <td>DESCRIPTION</td>
        <td>Qty</td>
        <td>PRICE</td>
        <td></td>
      </tr>
        <tr>
        <td>P1</td>
        <td>P1 Desc</td>
        <td>P1 Qty</td>
        <td>P1 Price</td>
        <td><img src="select.jpg" alt="select" class="select" /></td>
      </tr>
        <tr>
        <td>P2</td>
        <td>P2 Desc</td>
        <td>P2 Qty</td>
        <td>P2 Price</td>
        <td><img src="select.jpg" alt="select" class="select" /></td>
      </tr>
    </table>


$(".select").live('click', function(event) {
    var rselect;
    rselect = $(this).parent().parent().index();
$('.ProductSearch tr').each(function()
    {
      console.log($(this).html());
    });   
});
  • 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-07T06:10:22+00:00Added an answer on June 7, 2026 at 6:10 am

    you can try closest() method:

    $(".select").on('click', function(event) { // use `on()` as `live()` is deprecated
        var rselect;
        rselect = $(this).closest('td');
        console.log(rselect.html());
    });
    

    http://jsfiddle.net/NftQj/


    Update:

    if you want to iterate over the td elements of the tr you can try like below:

    $(".select").on('click', function(event) { // use `on()` as `live()` is deprecated
        var rselect;
        rselect = $(this).closest('tr');
        rselect.find('td').each(function(){
           console.log($(this).html());
        })
    });
    

    http://jsfiddle.net/NftQj/2/

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

Sidebar

Related Questions

I'm developing a simple invoice system using PHP and MySQL. My initial thought was
While developing an application using gwt in ecliplse crashed. Now the server is running
For developing an devices monitor system, I am using a InetAdress isReachable method to
I'm using vb.net and sql server 2000 for developing my application....The problem i'm having
Developing a game with AndEngine GLES2 I am having an issue trying to change
Developing a simple game for the iPhone, what gives a better performance? Using a
Developing a chrome extension using javascript is one of my university projects. I don't
Developing an interface generic I wished to declare a constructor in an interface but
Developing using MVC-3, Razor, C# Been searching around and cannot find advice I'm looking
Developing an application using SWT to work in both Linux and Windows. I created

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.