[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

[jQuery] Re: Selecting Parent

2008-02-15 Thread Jamie
Hey, I would change your .parents("a") to .parent() (unless you expect the img to be buried sometimes..). But to get the title, do this.parents("a").attr("title"); - Jamie Goodfellow On Feb 15, 4:44 pm, Steve Davis <[EMAIL PROTECTED]> wrote: > i have a table of linkedthumbnailed images like

[jQuery] Re: Selecting Parent

2008-02-15 Thread Steve Davis
nevermind. i found out it's as easy as using "$ (this).after(this.parentNode.title);" On Feb 15, 1:44 pm, Steve Davis <[EMAIL PROTECTED]> wrote: > i have a table of linkedthumbnailed images like this... > > rel="top_shelf.html" class="cluetip"> width="150" /> > > i want to dynamically add a text