If your jquery results array is in a variable (to reuse it instead of
re-querying over and over again) then what is the best way to get the nth
item from it *without modifying the array* ?
For instance the following would cause the myElements variable to end up
containing only one item!
var
i think element[n] would be the best, but im no expert.
On 11/23/06, George Adamson [EMAIL PROTECTED] wrote:
If your jquery results array is in a variable (to reuse it instead of
re-querying over and over again) then what is the best way to get the nth
item from it *without modifying the
There is an undocumented feature of jQuery where destructive methods (like
eq()) will accept a callback function as a second argument. That function
will have the new selection as 'this', but other methods on the chain will
still be using the origonal selection. i.e. $(div).eq(n,function(){
On 11/23/06, George Adamson [EMAIL PROTECTED] wrote:
- $(myElements[n])
If you want to wrap the nth element of myElements in a jQuery object, then
that looks like the way to go.
--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com
Blair McKenzie schrieb:
There is an undocumented feature of jQuery where destructive methods
(like eq()) will accept a callback function as a second argument. That
function will have the new selection as 'this', but other methods on
the chain will still be using the origonal selection. i.e.