I was wondering if the people over at jQuery implemented an alternative method to .get(), as in one that returns a jQuery object instead of a DOM node.
This way, I don’t have to
- wrap the object retrieved using the
.get()method with an additional$()call and - write my own jQuery plugin in order to provide that functionality.
I especially don’t want to do #2 because I will pretty much be reinventing the wheel, when a functionality already exists.
you can use .eq(index), which returns a jquery instance. For example
or as ThiefMaster pointed out in his comment below, these will work as well (and are potentially nicer depending what you are doing :))