简体   繁体   中英

Select specific object from array of objects jQuery

I have stupid problem (probably). I need to select one of these objects to be able to use.empty() and.append(), for example, on them.

My problem is that if I select them like objectlist[1] it returns the html element not the jquery object.

This is my question, how can you select an object from an array of objects like one bellow and still be able to apply functions like.empty() and.append().

  r.fn.init(7) [div.alert-display, div.alert-display, div.alert-display, div.alert-display, div.alert-display, div.alert-display, div.alert-display, prevObject: r.fn.init(1)]
0: div.alert-display
1: div.alert-display
2: div.alert-display
3: div.alert-display
4: div.alert-display
5: div.alert-display
6: div.alert-display
length: 7
prevObject: r.fn.init [document]
__proto__: Object(0)

You could use objectlist.eq(1)

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