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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:31:56+00:00 2026-06-10T00:31:56+00:00

i have a simple html table. I want to get the value of first

  • 0

i have a simple html table. I want to get the value of first column of a row on which i click.
if i click on first row anywhere it should get value of 1st column of 1st row ,if i click on 2nd row anywhere, it should give value of 1st column of second row..
here is my table:

<table style="border:1px solid black" id="tab">
    <tr>
        <td style="border-right:1px solid black">Sachin</td>
        <td>Yuvraj</td> 
    </tr>
    <tr>
        <td style="border-right:1px solid black">Virat</td>
        <td>Gautam</td>              
    </tr>
</table>
  • 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-10T00:31:58+00:00Added an answer on June 10, 2026 at 12:31 am
        $(document).ready(function(){
    
        //use this if you have jquery version 1.7+
          $('table#tab tr').on('click',function(){
              alert($(this).find('td:first').text());
    
        });
        //normal way
      $('table#tab tr').click(function(){
              alert($(this).find('td:first').text());
    
        });
    //delegation
    
    $('body').delegate('table#tab tr','click',function(){
              alert($(this).find('td:first').text());
    
        });
    
    //use any of these three methods
    
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple HTML table which is bound using knockoutJS. However, I've added
I'm trying to have a simple html table, that highlights a row as a
I have a simple html table element. <table border=2 cellpadding=5 cellspacing=0 width=40%> <tr><td> aaa
I have a simple HTML Table (10 columns x 500 rows). When the page
I have a simple table like this <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
I have the following task: there are a simple table from mysql database: <html>
I have a simple HTML Form with one column having a select menu with
I have an html table nested in an html table cell. I want the
I have a simple option tag in html which lists all users held on
I have this simple html piece of code, whenever I click on any of

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.