[jQuery] Re: ***DHSPAM*** [jQuery] Re: is child of...

2007-04-06 Thread Karl Swedberg
On Apr 6, 2007, at 8:53 AM, bmckenzie wrote: $("#someParent").children().index(someElement) != -1 ; Cool, Bruce! you could also come at it from the other direction: if ( $('#someChild').parent('someElement').length ) { //do something }; --Karl _ Karl Swedberg www.eng

[jQuery] Re: is child of...

2007-04-06 Thread bmckenzie
$("#someParent").children().index(someElement) != -1 ; ? On Apr 6, 5:50 am, "Lwis" <[EMAIL PROTECTED]> wrote: > Hi, > > short version: how do I find out whether my element is a child of > another element? > > long version: I think I want to loop through all elements and check > each of them i

[jQuery] Re: is child of...

2007-04-06 Thread Lwis
I was using prototype js before moving to jQuery. This was my script: var children = $('div').getElementsByTagName('*'); var childrenA = $A(children); var isChild = false; childrenA.each(function(child){ if (child === obj) {

[jQuery] Re: is child of...

2007-04-06 Thread Roman Weich
Lwis schrieb: Hi, short version: how do I find out whether my element is a child of another element? long version: I think I want to loop through all elements and check each of them if it is the element I am searching for or not. I think I want something similar to YUI (http://www.un-instraw.

[jQuery] Re: is child of...

2007-04-06 Thread Stefan Petre
Lwis wrote: Hi, short version: how do I find out whether my element is a child of another element? long version: I think I want to loop through all elements and check each of them if it is the element I am searching for or not. I think I want something similar to YUI (http://www.un-instraw.or