$('a.accept').click(function() { alert($(this).closest('tr').attr('id')); });
On Thu, Sep 24, 2009 at 11:22 AM, Steven <html...@gmail.com> wrote: > > I have a table that looks something like this: > > <tr id="1"> > <td>Name</td> > <td>E-Mail</td> > <td><a href="#" class="accept">Accept</a> - <a href="#" > class="deny">Deny</a></td> > </tr> > > With multiple rows. Each row has a unique ID (numerical). I need to be > able to click on an a.accept, find WHICH one was clicked (which row it > is in), and get the ID of that row. I've been looking around and I > found parent(), but I'm not sure how I can specifically get which > accept link was clicked. > > Can anyone help? -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.