[jQuery] Re: Selecting parent id

2009-02-01 Thread Manowar721
var getParent = function(){ myparentID = $(this).parent().parent().parent().attr("id"); parentID = "My table ID is: " + myparentID; alert (parentID); }; $("td").bind("click", getParent); Hope that helps, Manowar721 On Jan 31, 3:01 pm, Chrille wrote: > Hi everyone, > > I have a lot of ta

[jQuery] Re: Selecting parent ID

2009-01-31 Thread Karl Swedberg
If you want the id of the parent table, you can get it this way: $(this).parents('table')[0].id --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 31, 2009, at 4:57 PM, Christoffer wrote: Hi everyone, I have a lot of tables, like this: loremipsum lore