• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 78
  • Last Modified:

select the first td in a tr using jquery

hi,

I want to refer to the first td in a tr when i click a td in the row using jQuery, any idea?
0
joyacv2
Asked:
joyacv2
1 Solution
 
Rainer JeschorCommented:
Hi,
this should do the trick:
$(document).ready(function () {
    $("td").on("click", function() {
        var tr = $(this).closest('tr');
        alert($("td:first-child",tr).text());
    });
});

Open in new window

Sample:
http://jsfiddle.net/EE_RainerJ/yokpLxsh/

HTH
Rainer
0
 
joyacv2Author Commented:
perfect!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now