Hi Jean-Noel,
On Monday 22 June 2009 Jean-Noël Rivasseau wrote:
> I have a DOM element, and wish to find its first descendant with a given
> class.
>
> Will the following work?
>
> var myDomElement;
> qx.bom.Collection.query(".MyTargetClass",myDomElement)[0];
You don't have to provide the second parameter. This will set the start of the
query. If you want to query the whole document just remove it.
> Eg does the [0] guarantees that in the following case:
>
> <div id="myElement>
> <div class="MyTargetClass">
> <div class="MyTargetClass">
> </div>
> </div>
> </div>
>
> the first <div class="MyTargetClass"> is returned, not the inner one?
With
--snip--
qx.bom.Collection.query(".MyTargetClass")[0];
--snip--
you'll get the outer element (the first one).
cheers,
Alex
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel