I’m trying to manipulate a jQuery object to make the first item the last, second the first, third the second, and so on.
With an Array this would be simple:
myArray = [ "a", "b", "c", "d", "e" ];
myArray.add( myArray.shift() );
// done.
How can I do this with a jQuery object?
myObject = $('.myDiv').children();
myObject.nowWhat(?)
Thanks for any help.
The following should do it:
UPDATES:
get() returns an array of all the matched elements.
get(index) returns a single element of the matched elements