简体   繁体   中英

Using jquery selectors on array containing cloned dom elements

How would one go about using jQuery selectors on an array of cloned dom elements:

Say I created the array like this:

var refDom = $(".items").clone(true, true);

Would it be possible to return some of the elements via selectors, or atleast get the array index?

Of course, just do:

refDom.find('.somelement');

And to access the elements by index you can do:

refDom.eq(2).whatever();

您可以使用常规选择器:

refDom.find(".your-selector")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM