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
$("#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
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) {
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.
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
5 matches
Mail list logo